home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Mother of All Windows Books
/
CD-MOM.iso
/
cd_mom
/
newsletr
/
vbz
/
vbz1-3
/
clocks.bas
< prev
next >
Wrap
BASIC Source File
|
1992-04-24
|
889b
|
43 lines
DefInt A-Z
Global Const AppName$ = "sample"
Sub CleanUp ()
Unload frmSave
End Sub
Sub InitSave ()
frmSave.timSave.Interval = 1000
frmSave.timSave.Enabled = True
frmSave.Show
frmSave.ForeColor = &HFFFFF
frmSave.FontSize = 30
End Sub
Sub TimerProc ()
Static x, y, OldTime$
'Erase time you printed last by printing it again in the background color
frmSave.CurrentX = x
frmSave.CurrentY = y
frmSave.ForeColor = frmSave.BackColor
frmSave.Print OldTime
'Move current spot to a random spot that won't clip the time
theight = frmSave.TextHeight(Time)
x = Int((frmSave.ScaleWidth - frmSave.TextWidth(Time)) * Rnd)
y = Int((frmSave.ScaleHeight - frmSave.TextHeight(Time)) * Rnd)
frmSave.CurrentX = x
frmSave.CurrentY = y
'print the time in white
frmSave.ForeColor = &HFFFFF
OldTime$ = Time
frmSave.Print OldTime$
End Sub