DateTimepicker
-
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.
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
-
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
-
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.
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 -
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!
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
-
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. ~ MikeNever 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. -
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
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.
-
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.
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