Show Current Time (like a clock)

  • Thread starter Thread starter Rob H
  • Start date Start date
R

Rob H

I have removed the Start Bar from my project, but I would
like to show the current time on my form. I can see how I
can capture the current time and set its value to a Label
on the Form, but by doing this I am responsible for
updating the Label every minute. I feel that this is an
unnecessary process and there is an easy way to display
the time to be used like a clock.

Any guidance would be appreciated.
 
There is no "magic" way to do it. You'll have to have some control that
gets painted when the time changes. Doing something once every minute
wouldn't be considered very resource intensive.
 
I was a bit concerned about keeping the program from
hibernating. If you have thought on how to prevent this
from happening, please advise.
 
The app will sleep only when the device does. If you're periodically
polling the system clock with GetLocalTime, then it shouldn't matter,
because when the device wakes back up it'll continue reading the local time.
 
Chris are you saying that even though my app is
periodically polling the system clock, the device will
still go into hibernation mode. I thought this activity
would keep it from going into hibernation mode, kinda like
a never ending loop would do. By the way, thanks for your
prior messages.

Rob
 
A loop won't prevent hibernation unless it specifically resets the idle
timer.
 
Back
Top