Link to home
Create AccountLog in
Avatar of Nolanc
Nolanc

asked on

Show Running Time In VB.NET MDI Status Bar

Hi

In my VB.NET MDI Windows Application I have a Status Bar with a panel named StbTime. I wish to show the correct time (All the time) in this panel. What is the easiest way of doing this please. For example StbTime.Text = TimeOfDay is useless.

I am using Visual Studio 2008 running under Windows XP Pro.

Many thanks.
Avatar of kaufmed
kaufmed
Flag of United States of America image

>>  For example StbTime.Text = TimeOfDay is useless.

Well yes, in and of itself it is useless as I'm sure you found out, it will only update whenever the section of code you place that in is executed (e.g. a button being clicked). What you need is that code and a timer to fire that code at some defined interval (e.g. every second). Place that code inside of a Tick handler and start the timer when you're form loads--you should then have better results.
Avatar of Nolanc
Nolanc

ASKER


Hi kaufmed

I was hoping that you would provide me with some code to achieve this.  However, let me continue searching the Internet for code of this nature after which I will get back to you.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Nolanc

ASKER

Hi Savant

Thank you. It works beautifully.
Avatar of Nolanc

ASKER

Hi Savant

I merely replaced your statement No. 4 with my statement as follows: StbTime.Text = TimeOfDay. It works perfectly.

Thanks
Nolan