Results 1 to 3 of 3

Thread: [RESOLVED] Sleep?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Resolved [RESOLVED] Sleep?

    Hi Everyone,

    I used the below for sleeping in vb6, but how do I sleep in vb.NET 2005?

    The Sleep Windows API function lets you put the application to sleep. Enter the
    following declaration into a standard module.

    Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    Then, simply call the function from your code, as in:

    Sleep 5000

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: Sleep?

    vb Code:
    1. Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
    2.         Dim x As Long = 1200 'in milliseconds
    3.         System.Threading.Thread.Sleep(x) 'wait for 1200 milliseconds
    4.     End Sub
    Please mark you thread resolved using the Thread Tools as shown

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Re: Sleep?

    Excellent, thank you!

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