Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display real time on a form's header
Message
 
À
21/03/2002 23:58:57
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00635870
Message ID:
00635890
Vues:
17
Ravi,

Run this program to put a clock on the _screen caption along wiht your application's name.
_screen.addobject("MyTimer","MyTimer")
IF VARTYPE(pcCaption) = "C"
   _screen.MyTimer.ScreenCaption = pcCaption
ENDIF
_screen.MyTimer.Enabled = .T.

DEFINE CLASS MyTimer AS Timer
Interval = 1000
screencaption = ""

PROCEDURE Init
LOCAL lcTime, ltTime
ltTime = DATETIME()
lcTime = CDOW(ltTime) + " " + CMONTH(ltTime) + " " + ;
         ALLTRIM(TRANSFORM(DAY(ltTime))) + ", " + ;
         TRANSFORM(YEAR(ltTime)) + " " + ;
         TIME()
IF EMPTY(This.ScreenCaption)
   _screen.Caption = lcTime
ELSE
   _screen.caption = This.screencaption + " - " + lcTime
ENDIF

ENDPROC

PROCEDURE Timer
LOCAL lcTime, ltTime
ltTime = DATETIME()
lcTime = CDOW(ltTime) + " " + CMONTH(ltTime) + " " + ;
         ALLTRIM(TRANSFORM(DAY(ltTime))) + ", " + ;
         TRANSFORM(YEAR(ltTime)) + " " + ;
         TIME()
IF EMPTY(This.ScreenCaption)
   _screen.Caption = lcTime
ELSE
   _screen.caption = This.screencaption + " - " + lcTime
ENDIF
ENDPROC

ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform