How to Place a Timer in the Main WindowID: Q127942 3.00 WINDOWS The information in this article applies to:
SUMMARYThe Timer control is new to Visual FoxPro. It can execute code at regular intervals and is not a visual control. You can use the timer to periodically execute a set of commands. The following two sample programs illustrate the basic commands to place a timer on the Visual FoxPro version 3.0 desktop.
MORE INFORMATION
Method One: Use the ADDOBJECT() Method to Place the Timer on the DesktopThe _SCREEN system memory variable holds a reference to the main Visual FoxPro window. It allows you to manipulate it as a form. This memory variable will be used in this sample. The following code places a timer that displays the time. Similar code can be used to place any control on the desktop. Press the F6 key to release the timer. Place the following code in a program (.PRG) file:
Method two: Encapsulate the Object in a Container ClassThis sample program does the same operations as the first example. The timer is added to a container class, and the CREATEOBJECT() function instantiates the object. To execute the sample, place it in a .PRG file and run the program. Press the F6 key to release the timer.
Additional reference words: 3.00 VFoxWin
KBCategory:
KBSubcategory: FxprgGeneral
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |