Date/Time Picker Control in Visual Basic6.0

DateTimePicker  is  a ActiveX controls. The Date/Time Picker control allow the user to specify a date and time.Date/Time Picker control can display a MonthView as a drop down control or the current time with an up down control to let the user select the require time.A MonthView control or Date/time Picker control can be added to a program by using the following steps  The The DateTimePicker control enables you to provide a formatted date field . Users can select a date from a dropdown calendar interface similar to the MonthView control.

1.Click on “Start” Button.  select “All Programs, Microsoft Visual Studio 6.0 and  Microsoft Visual Basic 6.0.” .

2. Select “Standard EXE” from the list in the New Project dialog box and click on “Open.” Click on “Project” on the menu bar, then select “Components” from the drop-down menu.

3. Scroll down the list in the box until Microsoft Windows Common Controls2 6.0 (SP4) is visible. Click on the checkbox to select the component and then click on “OK.” All components show in the Toolbox.

4. Choose the “DT Picker1” control from the list of controls in the toolbox. Place the control on the form in Visual Basic.

5.Also place one Label1 ,Textbox and a monthview control on the Form1.

6.Set the caption property “Date” of Label1 .















7.Double click on form1.Code window is open .write code here as shown in figure below:




8.Press<F5> to run the program.Output is below:

Comments are closed.