|
I think you only need the form when you're referencing from another form.
D'oh! I actually DO have eVB installed on this machine... And since we had a huge power outage here a few months ago, my webserver is here. That means I have access to my source code that I have using the timer. It was originally going to be for a virtual pet, but it never got off the ground. Here is the source... enjoy.
Option Explicit
Declare Function Sleep Lib "coredll.dll" (seconds As Integer) As Long
Dim menuisup, x, Number As Integer, apath As String
Private Sub Form_Load()
If App.Path = "\" Then
apath = App.Path
Else
apath = App.Path & "\"
End If
ImageCtl1.Picture = apath & "vpetbg.bmp"
PictureBox1.Picture = apath & "spotblank.bmp"
Menu.Picture = apath & "botbar0.bmp"
Timer1.Interval = 100
Timer1.Enabled = True
Number = -1
Call Timer1_Timer
End Sub
Private Sub Timeout(duration)
On Error Resume Next
Timer1.Interval = 5000
Timer1.Enabled = True
Do While Timer1.Interval > 0
Loop
End Sub
Private Sub Form_OKClick()
App.End
End Sub
Private Sub PictureBox1_Click()
If menuisup = 0 And Number = -1 Then
Number = 0
Do While Number < 5
'nothing
Exit Do
Loop
End If
End Sub
Private Sub Menu_Click()
If menuisup = 1 And Number = 5 Then
Number = 4
Do While Number > 0
'nothing
Exit Do
Loop
End If
End Sub
Private Sub Timer1_Timer()
If Number > -1 And Abs(Number) < 5 Then
Menu.Picture = apath & "botbar" & Abs(Number) & ".bmp"
If menuisup = 0 Then
Number = Number + 1
If Number > 4 Then
menuisup = 1
End If
Else
Number = Number - 1
If Number < 0 Then
menuisup = 0
End If
End If
End If
End Sub
|