Results 1 to 8 of 8

Thread: Vb6 - Pausing a application ..

  1. #1

    Thread Starter
    Hyperactive Member spoiledkid's Avatar
    Join Date
    Oct 2002
    Location
    Canada
    Posts
    437

    Vb6 - Pausing a application ..

    Pausing a application without using timer control ...

    VB Code:
    1. Private Sub Pause(Optional Delay As Integer = 1)
    2. Dim dblWait As Double
    3.    
    4.     Let dblWait = Timer: Do Until Timer < dblWait Or Timer >= dblWait + Delay: DoEvents: Loop
    5. End Sub

  2. #2
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    What do you mean pause it? Just like setting the form enabled = true?

  3. #3

    Thread Starter
    Hyperactive Member spoiledkid's Avatar
    Join Date
    Oct 2002
    Location
    Canada
    Posts
    437
    Originally posted by Madboy
    What do you mean pause it? Just like setting the form enabled = true?
    pausing the application means halting it for a specified interval.

    Call that code from your form load like this ...

    Pause 10

    your form will not show when run until after 10 seconds .....

  4. #4
    New Member
    Join Date
    May 2007
    Posts
    1

    Thumbs up Re: Vb6 - Pausing a application ..

    Quote Originally Posted by spoiledkid
    pausing the application means halting it for a specified interval.

    Call that code from your form load like this ...

    Pause 10

    your form will not show when run until after 10 seconds .....
    --------
    Worked. Thanks!

  5. #5
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Vb6 - Pausing a application ..

    You could just use the Sleep() Function.

  6. #6
    Junior Member
    Join Date
    Feb 2007
    Posts
    28

    Re: Vb6 - Pausing a application ..

    Yes the Sleep function will do precisely the same thing
    But good to have another way of doing it

  7. #7
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: Vb6 - Pausing a application ..

    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.

  8. #8
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Vb6 - Pausing a application ..

    Ok thanks for the explanation it was just that spoiledkid said...

    your form will not show when run until after 10 seconds .....
    so i assumed it was something like the Sleep() function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width