Hello guys, part of the app i am doing which is almost done, i want to include running realtime.... i issued TIME() command, it only displays the time that it ran the app. What i want is to display the time while its running... any help? thanks so much....
If you have _screen = ON then VFP can display the time in _screens statusbar or somewhere on the _screen.
You can play around with this in developing mode by using these commands in the command window:
Code:
SET CLOCK ON
SET CLOCK TO 50,50
SET CLOCK STATUS
If _screen is not visible, surprise, surprise you're in need of a timer object that's fired every 60 seconds and writes the current time into the object you want to use for displaying the time. And 60 seconds is more than enough. Don't activate it every second. Reduce the time display to hh:mm and cut of the seconds.
But !!!!!! the best way of displaying the time without using App and Systemresources is to train your users to use the windows taskbar as it always shows date and time in the lower right corner or wherever the taskbar is positioned. Showing it in your app is redundant.
Tom has made a good point. There is already a clock in the notification area of the Windows taskbar. No need to display it in your app as well.
However, if you really want to do it yourself, follow these steps:
1. Create a form.
2. Drop a label and a timer on the form.
3. Set the timer's Interval to, say, 1 second.
4. In the timer's Timer event, set the caption of the label to the value returned by TIME().
5. Customise the appearance of the label (font, colour, size, etc). Also, customise the form, for example, by removing the title bar and making the label fill the form.
6. In your program, run the form.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.