Apr 30, 2010 09:37 AM
(This post was last modified: Apr 30, 2010 04:20 PM by codepoet.)
Show system time into StatusStrip (lable)
Code Private Sub TimerRelogio_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerRelogio.Tick
Me.lblTime.Text = Date.Now
End Sub
Private Sub frmMDIParent_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TimerRelogio.Start()
End Sub
If You Like this tutorial,
please check out my other tutorials by clicking ==> here
Thank you very much for this, I was looking for it.
Apr 30, 2010 09:40 AM
(This post was last modified: Apr 30, 2010 09:41 AM by Voluxe.)
Or:
Quote:Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.text = TimeOfDay
End Sub
Apr 30, 2010 09:42 AM
(This post was last modified: Apr 30, 2010 09:42 AM by ★Cooldude★.)
(Apr 30, 2010 09:40 AM)Voluxe Wrote: Or:Code Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.text = TimeOfDay
End Sub
Thanks, this is cleaner code.
sorry my code was not noob friendly.....lol
(Apr 30, 2010 09:45 AM)codepoet Wrote: sorry my code was not noob friendly.....lol
It's not that, not at all. It's just your code was for VB6.
Very basic but good for newbies.
To Short
If you are using a status strip, use this:
Double click the top of your form and add this:
Add a timer, double click it and add this code:
Code ToolStripStatusLabel1.Text = TimeOfDay
(Apr 30, 2010 10:58 AM)★Cooldude★ Wrote: If you are using a status strip, use this:
Double click the top of your form and add this:
Add a timer, double click it and add this code:
Code ToolStripStatusLabel1.Text = TimeOfDay
Your just posted exacly what i posted. Just edited a word.
(Apr 30, 2010 11:03 AM)Voluxe Wrote: Your just posted exacly what i posted. Just edited a word.
Well give me another way I can show the time of day? When there is limited ways of doing things, then sometimes you will have to use the same code. And I didn't copy it either. I typed it out. Not a hard bit of code.
Very basic, but still nice.
Thanks for sharing mate.
✌
no problem... i'm glad you like it
2short
If You Like this tutorial,
please check out my other tutorials by clicking ==> here
|