now i want to insert date and time in text box as it set in the computer ??
15 Replies - 7508 Views - Last Post: 10 July 2011 - 10:12 PM
Replies To: how can i insert date and time into textbox ?
#2
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:12 AM
date time picker control
#3
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:14 AM
it can insert it into text box ?????
#4
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:16 AM
no you wont need a text box the date time picker will update the time and date when you start the porgram or is that not what you want
#5
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:17 AM
no >> i want it in text box to insert it in db ?
#6
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:19 AM
Also you can use: Now or followed by many values depends on what you need. Like Now.Date, Now.Day and others.... alot
#7
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:21 AM
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox3.Text = Date.Now
End Sub
it did not work
This post has been edited by el - general: 10 July 2011 - 09:22 AM
#8
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:25 AM
No just TextBox3.Text = Now and if you need only date then TextBox3.Text = Now.Date
This post has been edited by smohd: 10 July 2011 - 09:26 AM
#9
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:28 AM
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox3.Text = Now
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox3.Text = Today
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox3.Text = Now.Date
End Sub
all these codes did not work
#10
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:32 AM
Why you put them in text changed? Do you know when that event is executed? When do you want you date to appear? when form is loaded? or when button is clicked?
#11
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:33 AM
all of these codes work but in button click >>> not automatically
no i want it when form is loaded ?
no i want it when form is loaded ?
#12
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:35 AM
Then put them in form_Load event, like:
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox3.Text = Now.Date End Sub
#13
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:37 AM
ya I made it
thanks a lot (smohd) for your time
have a nice day
thanks a lot (smohd) for your time
have a nice day
#14
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 09:38 PM
#15
Re: how can i insert date and time into textbox ?
Posted 10 July 2011 - 10:09 PM
Quote
I guess Sir Smohd deserves a plus sign? 
And he got it
|
|

New Topic/Question
Reply



MultiQuote






|