MonthCalendar in Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

This lesson describes the MonthCalendar control


This control displays a calendar that allows the user to select a range of dates, and is similar to the one displayed by the DateTimePicker control when its ShowUpDown property is False.

However the DateTimePicker is designed for selecting a single date, while the MonthCalendar control is a bit more powerful, and allows the user to select a range of dates.

They can select the dates by clicking and dragging across the calendar. After that you can use the SelectionRange, SelectionStart, and SelectionEnd properties to see what dates the user has selected.


Notice that i am able to select only 7 days which is total number or days that can be selected by default. To change that you set a different value for the MaxSelectionCount property.


You could also select a range of dates programmatically:

    MonthCalendar1.SelectionRange = New SelectionRange(Date.Today, Date.Today.AddDays(7))

Previous Lesson | Next Lesson

Share This

Home | About | Contact | Privacy Policy

Copyright 2017 - All Rights Reserved.