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

Time Picker...

Scheduled Pinned Locked Moved Visual Basic
3 Posts 2 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.
  • S Offline
    S Offline
    strName Chris
    wrote on last edited by
    #1

    Okay, I have a school assignment in which I have to use a DateTimePicker for both the date (calendar), and for selecting an events start time, and end time... What I need to know, is how to get the thing to let me select time without seconds (I know, custom format), and to hop by 30 minute increments.. Please help... I know it's easy, but time is pressing.

    "Beware of bugs in the above code; I have only proved it correct, not tried it."

    T 1 Reply Last reply
    0
    • S strName Chris

      Okay, I have a school assignment in which I have to use a DateTimePicker for both the date (calendar), and for selecting an events start time, and end time... What I need to know, is how to get the thing to let me select time without seconds (I know, custom format), and to hop by 30 minute increments.. Please help... I know it's easy, but time is pressing.

      "Beware of bugs in the above code; I have only proved it correct, not tried it."

      T Offline
      T Offline
      Tirthadip
      wrote on last edited by
      #2

      Hi Chris, I dont think there is any control for your requirement. what you can do take two NumericUpDown control.For 'minutes' set control's "Maximum" value to 30 and "Minimum" value to 0 and "Increment" to 30.Take a Combobox for AM and PM.Now create Time variable from this control input. I dont know any better solution.

      Live life to the fullest

      S 1 Reply Last reply
      0
      • T Tirthadip

        Hi Chris, I dont think there is any control for your requirement. what you can do take two NumericUpDown control.For 'minutes' set control's "Maximum" value to 30 and "Minimum" value to 0 and "Increment" to 30.Take a Combobox for AM and PM.Now create Time variable from this control input. I dont know any better solution.

        Live life to the fullest

        S Offline
        S Offline
        strName Chris
        wrote on last edited by
        #3

        That should work well... thanks for the reply. I was also thinking about using ComboBoxes, and adding all the increments manually, then just in code, have it find and remove the : and AM or PM characters (after storing them ofcourse) then convert to an integer (CINT) and compare what's left (630 > 600 then HalfAnHour=True) Still have some thinking to do... but it's due tommorow and I'm still hanging. The reason I have hesitated with the NumericUpDown controls is that I need fields to autopopulate on the lostfocus event of the end time. (and that's a little hard with 3 controls per time)

        "Beware of bugs in the above code; I have only proved it correct, not tried it."

        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