Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[VB.NET]Show system time

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
PHP & .NET Contributor.
Thank you very much for this, I was looking for it.
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: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
PHP & .NET Contributor.
(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.

Spoiler (Click to View)
If you are using a status strip, use this:

Double click the top of your form and add this:

Code
timer1.start

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:

Code
timer1.start

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
PHP & .NET Contributor.
If You Like this tutorial,
please check out my other tutorials by clicking ==> here
PHP & .NET Contributor.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by Debit.Oct 22, 2016 12:06 PM 6 185 Oct 22, 2016 12:06 PM
Last Post: Debit.
[.NET] by ExaNetJun 27, 2013 01:09 PM 5 572 Jun 27, 2013 01:09 PM
Last Post: ExaNet
[Shell] by PapayaMar 15, 2012 09:34 PM 6 163 Mar 15, 2012 09:34 PM
Last Post: darksrc