dcsimg
Results 1 to 4 of 4

Thread: easy question - pause

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329
    i feel stupid but if i want the program to pause for 2 seconds and not do anything what do i do?
    ______________

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Oetje
    oetje@home.nl
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  3. #3
    Guest
    Put a Timer control on your form (called Timer) and use this code:

    Public Sub Wait(seconds)
    'Turn timer on
    Timer.Enabled = True

    'Set Timer Interval
    Me.Timer.Interval = 1000 * seconds
    While Me.Timer.Interval > 0
    DoEvents
    Wend

    'Turn timer off
    Timer.Enabled = False
    End Sub

    Private Sub Timer_Timer()
    Timer.Interval = 0
    End Sub

    And use the sub wait with the number of seconds you want,
    for example:
    wait(3)
    the program waits for 3 seconds
    Bye

  4. #4
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987
    If you want to avoid using the API or a Timer control you can use this little function...

    Code:
    'Implementation
    Private Sub Form_Load()
    
      Wait 5
     
    End Sub
    
    Private Sub Wait(lSeconds As Long)
     Dim lStart As Long
     
      lStart = Timer
     
      Do Until Timer - lStart >= lSeconds
     
      Loop
     
    End Sub
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width