Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: ho me
  Where is ho me?
 
 Philippines
 ho me
 To: Khurram Khan Khan
  Where is Khurram Khan Khan?
 Karachi
 Pakistan
 Khurram Khan Khan
 Tags
Subject: RE: Calendar Control
Thread ID: 248701 Message ID: 248785 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Wednesday, December 23, 2009 11:12:05 AM         
   


> Highlight blank date in calendar form Image attached please check
>
> Detail:
> Calendar control class is used in this form.
>
>
> **** highlight the button with green else white 
> 
> select * from booking where Date == this.calendardate into cursor temp
> scan
> IF cncl="BOOKED"
> 	this.backcolor = rgb(0, 128, 0)
> ELSE
> 	this.backcolor = rgb(236,233,216)	
> ENDIF
> 	
> endscan
> 
> 
> clearcalendar() 
> 
> local i, x
> i = 1
> x = 1
> 
> for n = 0 to 43
>     if i < 7
> 		ExecuteDate = "thisform.nDay" + ALLTRIM(STR(x)) + ALLTRI(STR(i)) + "." + "caption"
> 		&ExecuteDate = ""
> 	endif
> 	if x = 7
> 		i = i + 1
> 		x = 0
> 	endif
> 	x = x + 1
> endfor
> 
> 
> 
> Previewmonth()      && Procedure 
> local i, x
> i = 1
> x = 1
> 
> this.clearcalendar()
> ltDate = GOMONTH(DATE(2009, 01, 01), this.nMonthProp)
> 
> for n = 0 to 41
>   	monthDate = ltDate + n
>     this.label1.caption = alltr(cmonth(ltDate)) + " " + alltr(transform(year(ltDate))) 
> 
>     if i < 7 and month(monthDate) == month(ltDate)
> 		ExecuteDate = "thisform.nDay" + ALLTRIM(STR(DOW(monthDate))) + ALLTRI(STR(i)) + "." + "caption"
> 		PutDate = "thisform.nDay" + ALLTRIM(STR(DOW(monthDate))) + ALLTRI(STR(i)) + "." + "calendardate"
> 		verifyDate = "thisform.nDay" + ALLTRIM(STR(DOW(monthDate))) + ALLTRI(STR(i)) + "." + "verifydate()"
> 		&ExecuteDate = ALLTR(STR(day(monthDate)))
> 		&PutDate = monthDate
> 		&verifyDate 
> 	endif
> 	if DOW(monthDate) = 7
> 		i = i + 1
> 		x = 1
> 	endif
> 	x = x + 1
> endfor
> 

>
> if Christian Tabligan online please check it last time you work on it.
>
>
>


Hi,

Just looking at the picture, maybe you can add validation when changing backcolor, check if the object has caption.

hth

ENTIRE THREAD

Calendar Control Posted by Khurram Khan Khan @ 12/22/2009 12:12:03 PM
RE: Calendar Control Posted by ho me @ 12/23/2009 11:12:05 AM