-
Dec 14th, 2014, 09:31 AM
#1
Thread Starter
Lively Member
datetime picker conversion
Code:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.TextBox1.Text = Me.DateTimePicker1.Value.ToFileTime
End Sub
End Class
At this point, once button1 is clicked it displays the datepicker1 value in textbox1, but what I need it to due is every time the button is clicked it updates the text within textbox1. My ultimate goal is to convert the value from two datetimepicker to its numerical equivalent and subtract the values from the two datetimepickers.
Thank you
-
Dec 14th, 2014, 11:37 AM
#2
Re: datetime picker conversion
As you currently have it written, every time you click the button the text in the textbox is updated with the value from the datetimepicker, so it is doing exactly what you say you want. You can see this by clicking the button, changing the value of the DTP, then clicking the button again.
Therefore, I'm not sure what it is you really want.
My usual boring signature: Nothing
-
Dec 14th, 2014, 07:57 PM
#3
Thread Starter
Lively Member
Re: datetime picker conversion
Sorry. I meant it is NOT doing what I want it to do. That is every time I click the button I would like it to update.
-
Dec 14th, 2014, 08:46 PM
#4
Re: datetime picker conversion
Originally Posted by pooky
Sorry. I meant it is NOT doing what I want it to do. That is every time I click the button I would like it to update.
But the code you have provided DOES do what you SAY you want it to do. Each time the Button is clicked, the Text of the TextBox will be updated based on the Value of the DateTimePicker. If that's not what you're seeing then the issue is not the code. If that is what you're seeing but it's not what you want then the problem is apparently that you are unable to provide a CLEAR explanation of what it is that you want. Try again. Explain EXACTLY what you expect to happen and EXACTLY what does happen. Provide a few examples even. We can't see what you're seeing and we certainly can't see what you're thinking. It's up to you to provide ALL the relevant information.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|