Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTimePicker - select Time only? 1

Status
Not open for further replies.

rjoubert

Programmer
Oct 2, 2003
1,843
US
Using VB.NET 2005

I placed a DateTimePicker control on my windows app form, and changed the Format property of the control to "Time." When I run the app and click the drop down arrow on the control, I still get a calendar control to select a date. Changing the date selected does nothing to affect the time displayed. Is there some other property I can set to allow me to select the time only? Or can I at least prevent the calendar from dropping down?
 
When I need a "TimePicker", I use the DateTimePicker. I set the Format to Time and the ShowUpDown property to True. The ShowUpDown property removes the drop down calendar and adds numeric-type up and down arrows. You can then select each part of the time (hour, minute, etc) and scroll it up and down.

If I need a dropdrown-type time picker, I use a combobox and fill it with intervals based on the requirement, which usually for me tends to be 15 or 30 minutes so the list is never "too" long.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Thanks...setting the ShowUpDown property to True was exactly what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top