M
mtczx232
before we discuss about the problem:
1.it's pity that microsoft not supply event that occur only when Today
is change.
2. it's not clear for what have DateSelected event. why I need to deal
with only select with Mouse?
3. I try to change the selection (on mode of max 1 for selection) by
mouse, and DateSelected not fire
Now we will start the story
When the user browse month with button top of control, the DateChanged
fire twice!!
So I try to stop this with this code:
(Sorry about the VB but it's belong also to microsoft)
Public Class Form1
Dim l As Date
Private Sub MonthCalendar1_DateChanged(ByVal sender As
System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs)
Handles MonthCalendar1.DateChanged
If l <> MonthCalendar1.SelectionRange.Start Then
l = MonthCalendar1.SelectionRange.Start
MonthCalendar1.AddBoldedDate(#10/2/2006#)
MonthCalendar1.UpdateBoldedDates()
End If
End Sub
End Class
this code cause the control to start jump up month (about 10 month
ahead) like have some loop.
you all can try it!!
1.it's pity that microsoft not supply event that occur only when Today
is change.
2. it's not clear for what have DateSelected event. why I need to deal
with only select with Mouse?
3. I try to change the selection (on mode of max 1 for selection) by
mouse, and DateSelected not fire
Now we will start the story
When the user browse month with button top of control, the DateChanged
fire twice!!
So I try to stop this with this code:
(Sorry about the VB but it's belong also to microsoft)
Public Class Form1
Dim l As Date
Private Sub MonthCalendar1_DateChanged(ByVal sender As
System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs)
Handles MonthCalendar1.DateChanged
If l <> MonthCalendar1.SelectionRange.Start Then
l = MonthCalendar1.SelectionRange.Start
MonthCalendar1.AddBoldedDate(#10/2/2006#)
MonthCalendar1.UpdateBoldedDates()
End If
End Sub
End Class
this code cause the control to start jump up month (about 10 month
ahead) like have some loop.
you all can try it!!