1 Attachment(s)
[RESOLVED] How to... StatusStrip Date, Clock
How can I add Date, Clock (and eventualy Progress Bar that loads when ListBox2 and ListBox3 are loaded) to this StatusStrip.
I added ProgressBar and 2 StatusLabels but the time and date don't refresh:
Private Sub StatusStrip_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles StatusStrip.ItemClicked
End Sub
Private Sub DateLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateLabel.Click
End Sub
Private Sub TimeLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimeLabel.Click
End Sub
Private Sub ProgressBar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBar.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DateLabel.Text = Now.ToString("dd MMMM yyyy")
TimeLabel.Text = Now.ToLongTimeString
End Sub
Re: How to... StatusStrip Date, Clock
It seems like you do not have a Timer component on your form, am I correct ¿
You will have to add a timer to your form, set the appropriate Interval for it ( 500 for example means half a second )
Then add this code :
Code:
DateLabel.Text = Now.ToString("dd MMMM yyyy")
TimeLabel.Text = Now.ToLongTimeString
In the Timer's Tick event as well.
Re: How to... StatusStrip Date, Clock
Private Sub StatusStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles StatusStrip1.ItemClicked
End Sub
Private Sub ProgressBar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBar.Click
End Sub
Private Sub DateLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateLabel.Click
End Sub
Private Sub TimeLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimeLabel.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DateLabel.Text = Now.ToString("dd MMMM yyyy")
TimeLabel.Text = TimeString
End Sub
Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
DateLabel.Text = Now.ToString("dd MMMM yyyy")
TimeLabel.Text = TimeString
End Sub
Re: How to... StatusStrip Date, Clock
Is this resolved or what, please inform us. Do not just post some code and we don't know whether you still have issues, or this thread is resolved.
Also, use code tags when posting, as stated here :
http://www.codeguru.com/forum/showthread.php?t=403073
Thank you :)
Re: How to... StatusStrip Date, Clock