PDA

Click to See Complete Forum and Search --> : [Resolved] calendar control not displaying new date


indydavid32
Nov 20th, 2003, 04:08 PM
I have some code that slectes the previous months dates and changes the selected dates of my calendars.

However, the calendar still displays the current month even though the selected date is the previous month.

Is there a differant setting I should be setting or a way to refresh the calendar?


Dim mm As Integer
Dim yy As String
Dim dtedate As Date
Dim dtedate1 As Date
mm = Date.Today.Month
yy = Date.Today.Year
If mm <> 1 Then
dtedate1 = mm.ToString.Trim() & "/01/" & yy.ToString
dtedate1 = dtedate1.AddDays(-1)
dtedate = mm - 1.ToString.Trim() & "/01/" & yy.ToString
Else
yy -= 1
dtedate = "12/01/" & yy.ToString
dtedate1 = "12/31/" & yy.ToString
End If
Calendar1.SelectedDate = dtedate
Calendar2.SelectedDate = dtedate1


Thanks

indydavid32
Nov 28th, 2003, 07:22 AM
For anyone interested in this, I just did the following.

Calendar1.SelectedDate = dtedate
Calendar1.TodaysDate = dtedate