hello,
could anyone tell me how to display the system date and time in a label?
i would like to do it so when a user logs on the labels text changes to display the users name and the date and time that they logged in!
thank you,
iain
Printable View
hello,
could anyone tell me how to display the system date and time in a label?
i would like to do it so when a user logs on the labels text changes to display the users name and the date and time that they logged in!
thank you,
iain
In the form load event just put:
vb Code:
Me.Label1.Text = Date.Now.Tostring
You can also mess around with the toString bit and use it to format the date/time
yeah thats got it!
thanks a lot
1 other thing,
how do i get it so it displays the persons name before it?
i tried.....
me.lblfeedback.text = '" & Name & "' Logged in Date.Now.ToString
it didnt like it!
oooh i got it.......
lblfeedback.text = (" " & Name & " Logged in ") & date.now.tostring
thanks for putting me on the right track Stimbo!!!!!!!
I think this might be it:
vb Code:
me.lblfeedback.text = System.Environment.UserName & " Logged in at: " & date.now.tostring
how would i get it so the clock refreshes and constantly displays the correct time?
Add a timer to your project, enable it and in the tick event put the code you have
cheers, i should have thought of that!!