Code snippet : selection date range from MonthCalendar control

Example requires a windows form and a MonthCalendar control named monthCalendar1.
You can find the start and end dates from the SelectionRange property, see this:


Dim selectedDateRange As SelectionRange = MonthCalendar1.SelectionRange
Dim StartDate As Date
Dim EndDate As Date
StartDate = selectedDateRange.Start
EndDate = selectedDateRange.End


SelectionRange selectedDateRange = MonthCalendar1.SelectionRange;
System.DateTime StartDate = selectedDateRange.Start;
System.DateTime EndDate = selectedDateRange.End;