Pausing a application without using timer control ...
VB Code:
Private Sub Pause(Optional Delay As Integer = 1) Dim dblWait As Double Let dblWait = Timer: Do Until Timer < dblWait Or Timer >= dblWait + Delay: DoEvents: Loop End Sub
Printable View
Pausing a application without using timer control ...
VB Code:
Private Sub Pause(Optional Delay As Integer = 1) Dim dblWait As Double Let dblWait = Timer: Do Until Timer < dblWait Or Timer >= dblWait + Delay: DoEvents: Loop End Sub
What do you mean pause it? Just like setting the form enabled = true?
pausing the application means halting it for a specified interval.Quote:
Originally posted by Madboy
What do you mean pause it? Just like setting the form enabled = true?
Call that code from your form load like this ...
Pause 10
your form will not show when run until after 10 seconds .....
--------Quote:
Originally Posted by spoiledkid
Worked. Thanks!
You could just use the Sleep() Function.
Yes the Sleep function will do precisely the same thing :)
But good to have another way of doing it ;)
Actually no, Sleep will do an entirely different thing. It halts the process entirely for the given amount of milliseconds. This means your program doesn't execute at all until given amount of time has passed.
The code in the first post keeps execution in the program and processor usage runs at 100% as it continuously checks for conditions.
Ok thanks for the explanation it was just that spoiledkid said...
so i assumed it was something like the Sleep() function :pQuote:
your form will not show when run until after 10 seconds .....