Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. I would like to create a textbox where I can input hour and minute.

I would like to create a textbox where I can input hour and minute.

Scheduled Pinned Locked Moved Visual Basic
tutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AlainStP
    wrote on last edited by
    #1

    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

    D L 2 Replies Last reply
    0
    • A AlainStP

      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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • A AlainStP

        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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        The DatePicker control allows you to do that, you just have to play around with its properties.

        A 1 Reply Last reply
        0
        • L Lost User

          The DatePicker control allows you to do that, you just have to play around with its properties.

          A Offline
          A Offline
          AlainStP
          wrote on last edited by
          #4

          Thanks this is exactly what I was looking for asp

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups