Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asp Calendar control problem

Status
Not open for further replies.

motte

Programmer
May 31, 2001
155
US
Hi everyone. Its been a while since I've needed help, but I need some now. I am trying to, when the page loads, select the current date & the next 10 days. However, I am having some killer problems.

Code:
Public Sub Calendar1_DayRender(ByVal sender As System.Object, ByVal e As DayRenderEventArgs) Handles Calendar1.DayRender

    Dim tc As TableCell
    tc = New TableCell()
    tc.BackColor = Color.Crimson

    Calendar1.SelectedDayStyle().BackColor = tc.BackColor

    Dim i As Integer
    For i = 0 To 10

      If Date.Now.AddDays(i).ToShortDateString >=     Date.Now.ToShortDateString And Date.Now.AddDays(i).ToShortDateString < Date.Now.AddDays(10).ToShortDateString Then

          tc.Text = Date.Now.AddDays(i).ToShortDateString & &quot; &quot; & i   
          Label1.Text = tc.Text

          tc.BackColor = Color.DarkGreen
          Calendar1.DayStyle.BackColor = tc.BackColor
       
         ' right here is my problem. How do I set a day on the calendar???not a day selected, but just a day (in fact, one that equals the day in the loop).

      End If

   Next

End Sub

Any and all help is much appreciated.

Thanks, Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top