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

DateTimepicker

Scheduled Pinned Locked Moved Visual Basic
help
8 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.
  • S Offline
    S Offline
    shakizil
    wrote on last edited by
    #1

    I would like to be able to click on the drop down arrow. Pick the date and once I click it should show the date in a seperate text box. Does anyone know the code for that. Any help would be appreciated. Thanks.

    D M 2 Replies Last reply
    0
    • S shakizil

      I would like to be able to click on the drop down arrow. Pick the date and once I click it should show the date in a seperate text box. Does anyone know the code for that. Any help would be appreciated. Thanks.

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

      Handle the DateTimePicker's ValueChanged event. Get the Value from your DateTimePicker control, convert it to a String in the format you want and set the Text property of your TextBox. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Handle the DateTimePicker's ValueChanged event. Get the Value from your DateTimePicker control, convert it to a String in the format you want and set the Text property of your TextBox. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        S Offline
        S Offline
        shakizil
        wrote on last edited by
        #3

        Thanks Dave, How do I put all this in code language. I am sorry for being so dumb but I am new to VB.Net and just want to get over with this stupid project. Please help!

        D 1 Reply Last reply
        0
        • S shakizil

          I would like to be able to click on the drop down arrow. Pick the date and once I click it should show the date in a seperate text box. Does anyone know the code for that. Any help would be appreciated. Thanks.

          M Offline
          M Offline
          Mike K Clark
          wrote on last edited by
          #4

          Originally yes, the first reply is correct, although another alternative would be to set the textbox.text property value. Say for instance you have a text box named txtbxdate and a date & time picker named datetm. You would need to set the code of the text box to equal the date selected from the date & time drop down. It would look something like this txtbxdate.text = datetm.selecteddate or something like that I'm not actually running visual studios so I don't know exactly what the date & time picker property looks like but i know you can set the text of a text box to the date & time selected on the date & time box. ~ Mike

          S 1 Reply Last reply
          0
          • S shakizil

            Thanks Dave, How do I put all this in code language. I am sorry for being so dumb but I am new to VB.Net and just want to get over with this stupid project. Please help!

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

            shakizil wrote:

            I am new to VB.Net and just want to get over with this stupid project.

            Why does this scream "HOMEWORK ASSIGNMENT"??? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            L 1 Reply Last reply
            0
            • M Mike K Clark

              Originally yes, the first reply is correct, although another alternative would be to set the textbox.text property value. Say for instance you have a text box named txtbxdate and a date & time picker named datetm. You would need to set the code of the text box to equal the date selected from the date & time drop down. It would look something like this txtbxdate.text = datetm.selecteddate or something like that I'm not actually running visual studios so I don't know exactly what the date & time picker property looks like but i know you can set the text of a text box to the date & time selected on the date & time box. ~ Mike

              S Offline
              S Offline
              shakizil
              wrote on last edited by
              #6

              Never mind. I got it. Its only a one line code that takes care of the problem. Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged Me.txttrgdt.Text = Me.DateTimePicker1.Value.ToString("MM/dd/yyyy") End Sub There you go guys. And Dave this is not a HOME WORK ASSIGNMENT. Thanks.

              1 Reply Last reply
              0
              • D Dave Kreskowiak

                shakizil wrote:

                I am new to VB.Net and just want to get over with this stupid project.

                Why does this scream "HOMEWORK ASSIGNMENT"??? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

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

                Dave Kreskowiak wrote:

                Why does this scream "HOMEWORK ASSIGNMENT"???

                Don't look the people in that way. I usually meet this problem. I don't have any home work from school. But sometime i have my own idea to build an application, sometime i have an idea to do it but don't know how to code it.

                D 1 Reply Last reply
                0
                • L Lost User

                  Dave Kreskowiak wrote:

                  Why does this scream "HOMEWORK ASSIGNMENT"???

                  Don't look the people in that way. I usually meet this problem. I don't have any home work from school. But sometime i have my own idea to build an application, sometime i have an idea to do it but don't know how to code it.

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

                  Roath Kanel wrote:

                  But sometime i have my own idea to build an application,

                  I seriously doubt that's the case here, simply because of this one statement he made: ...just want to get over with this stupid project. This is telling me it's something he doesn't want to do. The only thing that fits his profile of a newbie and an assignment he/she doesn't want is homework. I, and many people here, will not write someones homework assignment for them. That's what RentACoder is for! We'll help with code that is already written, but won't write it for them. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                  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