469,332 Members | 6,649 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,332 developers. It's quick & easy.

time edit box


Is there a simple time only edit box available. I have a datetime on
the database but I only want to set the hours and minutes. Any
suggestions?
Aug 15 '08 #1
4 5541
On Thu, 14 Aug 2008 22:09:17 -0700, Ken Foskey
<rm**********@optushome.com.auwrote:
Is there a simple time only edit box available. I have a datetime on
the database but I only want to set the hours and minutes. Any
suggestions?
You could use a couple of NumericUpDown controls, one for hours and one
for minutes. Put a Label with a colon in between them. :)
Aug 15 '08 #2
On Aug 15, 9:16*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Thu, 14 Aug 2008 22:09:17 -0700, Ken Foskey *

<rmove.fos...@optushome.com.auwrote:
Is there a simple time only edit box available. * I have a datetime on
the database but I only want to set the hours and minutes. *Any
suggestions?

You could use a couple of NumericUpDown controls, one for hours and one *
for minutes. *Put a Label with a colon in between them. *:)
Alternatively, a MaskedTextBox with a mask of "90:00" could be used.

The problem is localization. A colon symbol in the mask will be
automatically changed to the proper time delimiter for the current
locale, but there's also the AM/PM issue.

Aug 15 '08 #3

"Ken Foskey" wrote:
>
Is there a simple time only edit box available. I have a datetime on
the database but I only want to set the hours and minutes. Any
suggestions?
Hi Ken,

Use a DateTimePicker. Set it's Format to Custom and use the CustomFormat
"HH:mm" (HH for 24 hours or hh for 12). Set ShowUpDown to true to hide the
calendar dropdown and switch to NumericUpDown mode.

--
Happy Coding!
Morten Wennevik [C# MVP]

Aug 15 '08 #4
On Thu, 14 Aug 2008 23:52:01 -0700, Morten Wennevik [C# MVP] wrote:
Use a DateTimePicker. Set it's Format to Custom and use the
CustomFormat "HH:mm" (HH for 24 hours or hh for 12). Set ShowUpDown to
true to hide the calendar dropdown and switch to NumericUpDown mode.

Thanks...
Aug 15 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.