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.
.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
Nolanc

8/22/2022 - Mon
kaufmed

>>  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.
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
Mike Tomlinson

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Nolanc

ASKER
Hi Savant

Thank you. It works beautifully.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Nolanc

ASKER
Hi Savant

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

Thanks
Nolan