* "Brad Sanders" <an*******@discussions.microsoft.com> scripsit:
I am working on an application and would like to display
the current time in the statusbar on the main form. Is
there an easy way to keep the current time displayed? I
know that I can always set the statusbar section text to
time.now but it seams like I would have to place this
where it would get called all of the time. Any thoughts.
Add a Timer control from the toolbox to the form
('System.Windows.Forms.Timer'), set its 'Interval' property to '1000'
and the 'Enabled' property to 'True'. Then add code like this to its
'Tick' event handler:
\\\
sbStatusBar.Text = Today.Date.ToString("dd.MM.yyyy") & ", " & TimeOfDay.ToString("hh:mm:ss")
///
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>