|
-
November 12th, 2003, 11:35 PM
#2
Well, u could use the styleset method of ssmonth. You can have a procedure like:
Private Sub CreateCalendarStylesets()
shmMontStyleSets.Add "DayCaptionAlignment"
shmMonth.StyleSets.Add "Meetings"
shmMonth.StyleSets.Add "Appointments"
shmMonth.StyleSets.Add "WeekEnd"
shmMonth.StyleSets.Add "WorkingDay"
shmMonth.StyleSets("DayCaptionAlignment").BackColor = shmMonth.BevelColorFace
shmMonth.StyleSets("DayCaptionAlignment").ForeColor = shmMonth.ForeColor
shmMonth.StyleSets("WorkingDay").BackColor = shmMonth.BevelColorFace
shmMonth.StyleSets("WorkingDay").ForeColor = shmMonth.ForeColor
shmMonth.StyleSets("WeekEnd").BackColor = shmMonth.BevelColorFace
shmMonth.StyleSets("WeekEnd").ForeColor = &HFF& 'Red
shmMonth.StyleSets("Meetings").BackColor = &H80FF80 'Green
shmMonth.StyleSets("Appointments").BackColor = &HFF& 'Red
end sub
U can then apply these stylesets on any day u want. The logic u have to sort out. U can also use the Tagvariant ptoperty of Monthview control. For e.g., if u have a recordset that fetches all appointments for a month, then u can add these days into the selected days collection. For each such day u can set the Tagvariant. For e.g:
If IsNull(shmMonth.SelectedDays(0).TagVariant) Then
shmMonth.SelectedDays(0).TagVariant = strApptName & "'" & lngApptID
Else
shmMonth.SelectedDays(0).TagVariant = shmMonth.SelectedDays(0).TagVariant & "''" & strApptName & "'" & lngApptID 'The single " ' " is used as a delimiter to separate a the appointment id and name of the same appointment. The double " '' " has been used to delimit each such occurence of an appointment. I have used this schema to handle multiple occurences of appointments on a single day.
End If
The above tagvariant information u can utilize to display a tooltip on a day that will highlight for e.g., "Presentation 0900 - 1200 hrs, Tech meeting 1500 - 1600 hrs" etc. on the month calendar. Ofcourse u have to do a little bit of programming in the mousemove event (see also DayFromPos property) of the month control to utilize the tagvariant information that has been stored earlier.
Hope u have grabbed the idea. Wishing u a good programming session!!
While BUG_IN_PROGRAM
ApplyPatch
wend
Private Sub ApplyPatch
BUG_IN_PROGRAM = True
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|