

The MonthView control, shown in Figure 8-7, is a much simpler proposition. This can lead to some very obscure results, such as if you set the custom format to mm/dd/yyyy.įigure 8-6 Three implementations of the Microsoft DateTimePicker control If you use a lower-case m, the control will display minute information where you expected the month to be. When using a custom format with the DatePicker control, be careful to specify the month part with an upper-case M. The chosen date or time is made available to you through the control's Value property as a Date data type. You can also replace the combo box with the spinner for the date display by setting the DateTimePicker control's UpDown property to True. The control can also be used for the display and input of time information by setting its Format property to dtpTime, in which case the dropdown combo box is replaced by a Spin control. The DateTimePicker control, shown in Figure 8-6, works similarly to a drop-down combo box: users can enter information directly into the text field at the top, or if they prefer they can use the drop down to reveal a Picker from which they can select their date. Either control can be used for date entry and display. Both of these can be found in the Microsoft Windows Common Controls_2 6.0 component. New additions to the latest version of Visual Basic are the DateTimePicker (DTPicker) and MonthView controls.
