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. C#
  4. Datetimepicker: manual input

Datetimepicker: manual input

Scheduled Pinned Locked Moved C#
question
6 Posts 4 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.
  • M Offline
    M Offline
    mSh1985
    wrote on last edited by
    #1

    I've been googling a while for this, but haven't found anything useful.. When a user wants to enter a date manually in a datetimepicker (dateformat short), instead of selecting a certain date, the cursor stays endlessly in the monthfield. The user has to type a "/" or press the cursor right to go to the dayfield and yearfield to type the date. I was wondering if there is a simple way of changing this behavior so the user can enter the date without having to press the cursor right button, and just input the numbers. (thus typing "10102010" instead of "10/10/2010") I can't use a masked textbox because i don't want to lose the calendarfuncionality. Does anyone have any experience with this? or are there controls available with this functionality? Thanks in advance.

    L M V 3 Replies Last reply
    0
    • M mSh1985

      I've been googling a while for this, but haven't found anything useful.. When a user wants to enter a date manually in a datetimepicker (dateformat short), instead of selecting a certain date, the cursor stays endlessly in the monthfield. The user has to type a "/" or press the cursor right to go to the dayfield and yearfield to type the date. I was wondering if there is a simple way of changing this behavior so the user can enter the date without having to press the cursor right button, and just input the numbers. (thus typing "10102010" instead of "10/10/2010") I can't use a masked textbox because i don't want to lose the calendarfuncionality. Does anyone have any experience with this? or are there controls available with this functionality? Thanks in advance.

      L Offline
      L Offline
      Lukasz Nowakowski
      wrote on last edited by
      #2

      Why don't you ask it on Windows Forms forum?

      Don't forget to rate answer, that helped you. It will allow other people find their answers faster.

      1 Reply Last reply
      0
      • M mSh1985

        I've been googling a while for this, but haven't found anything useful.. When a user wants to enter a date manually in a datetimepicker (dateformat short), instead of selecting a certain date, the cursor stays endlessly in the monthfield. The user has to type a "/" or press the cursor right to go to the dayfield and yearfield to type the date. I was wondering if there is a simple way of changing this behavior so the user can enter the date without having to press the cursor right button, and just input the numbers. (thus typing "10102010" instead of "10/10/2010") I can't use a masked textbox because i don't want to lose the calendarfuncionality. Does anyone have any experience with this? or are there controls available with this functionality? Thanks in advance.

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        Not using the standard control. You could detect the user clicking into the edit box and swap out to a masked textbox, format the data on exit, pass the formatted value back to the dtp. You will however find there is an endless number of potential formats that you need to cater for and it will drive you absolutely nuts. Most of us have chewed on this over the years. I recommend you simply tell the user it cannot be done, unless that is you have lots of spare time and nothing to fill it.

        Never underestimate the power of human stupidity RAH

        M 1 Reply Last reply
        0
        • M mSh1985

          I've been googling a while for this, but haven't found anything useful.. When a user wants to enter a date manually in a datetimepicker (dateformat short), instead of selecting a certain date, the cursor stays endlessly in the monthfield. The user has to type a "/" or press the cursor right to go to the dayfield and yearfield to type the date. I was wondering if there is a simple way of changing this behavior so the user can enter the date without having to press the cursor right button, and just input the numbers. (thus typing "10102010" instead of "10/10/2010") I can't use a masked textbox because i don't want to lose the calendarfuncionality. Does anyone have any experience with this? or are there controls available with this functionality? Thanks in advance.

          V Offline
          V Offline
          V 0
          wrote on last edited by
          #4

          Is it an option to to put a masked textbox and datetimepicker one over the other with a checkbox next to them? The Checkbox would toggle the readonly (datetimepicker) or the enter value (masked textbox) on or off.

          V.

          M 1 Reply Last reply
          0
          • M Mycroft Holmes

            Not using the standard control. You could detect the user clicking into the edit box and swap out to a masked textbox, format the data on exit, pass the formatted value back to the dtp. You will however find there is an endless number of potential formats that you need to cater for and it will drive you absolutely nuts. Most of us have chewed on this over the years. I recommend you simply tell the user it cannot be done, unless that is you have lots of spare time and nothing to fill it.

            Never underestimate the power of human stupidity RAH

            M Offline
            M Offline
            mSh1985
            wrote on last edited by
            #5

            I was afraid of that :) I guess i have to wait until my boss is back from his vacation to ask him if i can waste my time with it Thank you for your reply!

            1 Reply Last reply
            0
            • V V 0

              Is it an option to to put a masked textbox and datetimepicker one over the other with a checkbox next to them? The Checkbox would toggle the readonly (datetimepicker) or the enter value (masked textbox) on or off.

              V.

              M Offline
              M Offline
              mSh1985
              wrote on last edited by
              #6

              I thought of it as one of the possibilities.. thank you for your reply!

              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