The DateTimePicker control allows you to display and collect date and time from the user with a specified format.
The DateTimePicker control prompts the user for a date or time using a graphical calendar with scroll arrows. The most important property of the DateTimePicker is the Value property, which holds the selected date and time.
DateTimePicker1.Value = "12/31/2010"
The Value property is set to the current date by default. You can use the Text property or the appropriate
member of Value to get the date and time value.
Dim idate As String
idate = DateTimePicker1.Value
The control can display one of several styles, depending on its property values. The values can be displayed in four
formats, which are set by the Format property: Long, Short, Time, or Custom.
DateTimePicker1.Format = DateTimePickerFormat.Short
The following VB.Net program shows how to set and get the value of a DateTimePicker1 control.
- Visual Studio IDE
- How to Create a vb.net Windows Forms Application
- Label Control
- Button Control
- TextBox Control
- ComboBox Control
- ListBox Control
- Checked ListBox Control
- RadioButton Control
- CheckBox Control
- PictureBox Control
- ProgressBar Control
- ScrollBars Control
- Treeview Control
- ListView Control
- Menu Control
- MDI Form
- Color Dialog Box
- Font Dialog Box
- OpenFile Dialog Box
- Print Dialog Box
- KeyPress event in VB.NET
- How to create Dynamic Controls in VB.NET ?
- How do i keep a form on top of others
- Timer Control - VB.Net