Calendar Controls

VB.NET supports two types of calendar controls: the MonthCalendar and the DateTimePicker. Each allows the user to select a date or time from a graphical control. They should be used instead of textboxes whenever possible because they reduce the chance of data entry errors for dates (such as entering February 31).


The DateTimePicker control allows the user to select a date and/or time from a graphical control. The format of the date/time displayed can be controlled using the Format property. The properties MinDate and MaxDate can be used to specify a limit for the dates shown. The Value property contains the selected date/time. Additional properties control the appearance of the control.

In the directory for this ...

Get Application Development Using Visual Basic® and .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.