CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    9

    Question Pause Between SendKeys

    I have this inside a timer:

    tmrRFR.Interval = 3000
    Line2.Text = "testing"
    SendKeys.Send(Line2.Text)
    SendKeys.Send("{ENTER}")
    -------------------------------------------------NEED A PAUSE HERE
    Line3.Text = "woot"
    SendKeys.Send(Line3.Text)
    SendKeys.Send("{ENTER}")
    tmrRFR.Enabled = False

    How can I put a pause in the code after the first line of text is sent? It's been awhile since I have dealt with pausing so any help would be appreciated.

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Pause Between SendKeys

    Sleep command might be what you are looking for. 1000 = 1 second
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    May 2008
    Posts
    9

    Re: Pause Between SendKeys

    I tried using Threading.Thread.Sleep(3000), but the program hangs up quite a bit and then just sends all the input at once anyway.

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Pause Between SendKeys

    Threading.Sleep? Sounds like you are using VB.Net instead of VB6.

    There are several ways you can do this but without knowing what you are trying to do and what langauge you are using it is difficult to say. You may want to use a string array and call your send keys function from a timer which could send the next string from your array with each call.
    Always use [code][/code] tags when posting code.

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

Featured