MonthCalendar: Get visible range

I have a MonthCalendar setup that displays 2 months across and 3 months down for a total of 6 visible months. Does anyone know a way in vb.Net to programmatically determine the months that are currently visible? Thanks.
LVL 1
rbichonAsked:
Who is Participating?
 
Wayne Taylor (webtubbs)Commented:
Hi rbichon,

You can use GetDisplayRange....

        Dim StartDate As Date = Me.MonthCalendar1.GetDisplayRange(True).Start
        Dim endDate As Date = Me.MonthCalendar1.GetDisplayRange(True).End
        MsgBox("MonthCalendar displaying dates between " & StartDate & " and " & endDate)

Regards,

Wayne
0
 
rbichonAuthor Commented:
Is there an event that fires when the display range changes?
0
 
Wayne Taylor (webtubbs)Commented:
No, there's not, but you could capture the DateChanged event, which fires when the selected date has changed, which also happens when the visible range is changed.
0
 
rbichonAuthor Commented:
It doesn't always happen. Only when the current date is no longer in the visible range. I will just use the events when the control is clicked or the mousewheel is detected.

Do you know if there is an easy way to remove the bolded dates?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.