I would like to create a textbox where I can input hour and minute.
-
-
I am trying to figure out how to create a textbox, or another component where the user can click up and down to change the time (hours and minutes). Like the one we use in windows when we need to change the hour/minute of our OS. Thanks again asp
I've never made one, but you could easily do this with a custom UserControl. A few textboxes and a couple of buttons should do it.
HourTextBox : MinuteTextBox : SecondsTextBox AmPmTextBox UpButton DownButton
Shouldn't be hard to figure out what to put in the Up/Down Button click handlers. You'll probably also handle the MouseDown/MouseUp events on those if the user wants to change the numbers without clicking for each increment. Then the UserControl just exposes the time as a property. The gettor just puts a datetime object together based on the values in the textboxes. The settor does the opposite.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
I am trying to figure out how to create a textbox, or another component where the user can click up and down to change the time (hours and minutes). Like the one we use in windows when we need to change the hour/minute of our OS. Thanks again asp
-
The DatePicker control allows you to do that, you just have to play around with its properties.