[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

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.
0
rbichon
Asked:
rbichon
  • 2
  • 2
1 Solution
 
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now