Hi all,
i understand that the timer in VB6 is counting endllessly based on the interval set. i would like to to have a timer that only count once (say 3 sec) and execute the event. can someone kindly help me in this.
longwar
Printable View
Hi all,
i understand that the timer in VB6 is counting endllessly based on the interval set. i would like to to have a timer that only count once (say 3 sec) and execute the event. can someone kindly help me in this.
longwar
just disable the timer at the end of the timer's event:
VB Code:
Private Sub Form_Load() Timer1.Interval = 3000 '3 secs Timer1.Enabled = True End Sub Private Sub Timer1_Timer() MsgBox "hello" 'and all your code Timer1.Enabled = False 'event executed only once or work whenever you 'enable the timer explicitly End Sub