time edit box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ken Foskey

    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?
  • Peter Duniho

    #2
    Re: time edit box

    On Thu, 14 Aug 2008 22:09:17 -0700, Ken Foskey
    <rmove.foskey@o ptushome.com.au 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?
    You could use a couple of NumericUpDown controls, one for hours and one
    for minutes. Put a Label with a colon in between them. :)

    Comment

    • Pavel Minaev

      #3
      Re: time edit box

      On Aug 15, 9:16 am, "Peter Duniho" <NpOeStPe...@nn owslpianmk.com>
      wrote:
      On Thu, 14 Aug 2008 22:09:17 -0700, Ken Foskey  
      >
      <rmove.fos...@o ptushome.com.au 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?
      >
      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.

      Comment

      • =?Utf-8?B?TW9ydGVuIFdlbm5ldmlrIFtDIyBNVlBd?=

        #4
        RE: time edit box


        "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]

        Comment

        • Ken Foskey

          #5
          Re: time edit box

          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...

          Comment

          Working...