pcdoc2010

Hi, I'm a super newbie with this and I have tried the tutorials and examples in help, but I'm still not getting it.
I haven't bought a book yet, but that will be my next step as I really need some hard copy reference material.

Here is what I am trying to do:

I want a calendar in which you can click on a day and the label box will tell you a predefined statement for that day.
For example: the 15th is a payday, so you click the 15th and the label box reads Payday.

Where I am getting confused is I have no idea what any of the code means. I could probably figure it out given the code and what it is doing, but the help example is from 2005 and is not clear to me at all.


Here is my code:

Partial Class _Default
Inherits System.Web.UI.Page


Protected Sub ActivityCalendar_DayRender(ByVal sender As Object, ByVal e As DayRenderEventArgs) Handles ActivityCalendar.DayRender
' Display activity dates in yellow boxes.
Dim activityStyle As New Style()
With activityStyle
.BackColor = System.Drawing.Color.Yellow
.BorderWidth = New Unit(2)
End With

' Activity dates are Paydates every 2 weeks for 2007.
If ((e.Day.Date = New Date(2007, 8, 10)) _
Or (e.Day.Date = New Date(2007, 8, 24)) _
Or (e.Day.Date = New Date(2007, 9, 7)) _
Or (e.Day.Date = New Date(2007, 9, 21)) _
Or (e.Day.Date = New Date(2007, 10, 5)) _
Or (e.Day.Date = New Date(2007, 10, 19)) _
Or (e.Day.Date = New Date(2007, 11, 2)) _
Or (e.Day.Date = New Date(2007, 11, 16)) _
Or (e.Day.Date = New Date(2007, 11, 30)) _
Or (e.Day.Date = New Date(2007, 12, 14)) _
Or (e.Day.Date = New Date(2007, 12, 28))) Then
e.Cell.ApplyStyle(activityStyle)
End If

End Sub

End Class


Any help would be great...

Thanks,
Dan


Re: Visual Basic Express Edition Calendar help dayrender

pcdoc2010

I think I figured it out:

If ActivityCalendar.SelectedDate = New Date(2007, 8, 10) Then
Label1.Text = "Pay Day"
End If




Re: Visual Basic Express Edition Calendar help dayrender

Martin Xie - MSFT

Thank you Pcdoc for sharing your experience with other members here.

Thank you for your active participation in this forum!