-
This is my prob, i have a form running throughout the whole program. This form has a timer with the interval of 1000 (1sec). If it sees a form, i would like it to wait 5 seconds before it closes it. Now i dont want it ot call another timer to close it so is there any other way?
-
Sleepppppp....
You could use the sleep function
(but again, i think it's only in VB6)
Code
Private Declare Sub Sleep Lib "kernel32" _
(ByVal dwMilliseconds As Long)
Call Sleep(5000) '5 seconds
End
-
;o\
Yeah vb doesnt have the sleep function, plus i want everything else to be working. I just want 1 form to close in 5 seconds. I guess im going to have to use another timer.....EEKKK
-
<?>
could you not do something like this.
wherever you find the window open
Timer2.interval = 1000
Timer2.enabled=true
x = x + 1
if x = 5 then
'close the window
x = 0
timer2.enabled = false
-
You could have a counter counting the seconds in the timer
Code:
Static counter as integer
'to activate it counter=counter+1
if counter then counter=counter+1 'increments if activated
if counter=6 then '5 seconds passed
'do your stuff
counter=0'disable the counter
end if