Results 1 to 3 of 3

Thread: [RESOLVED] sendkey

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Resolved [RESOLVED] sendkey

    hi,
    what is the difference between the sendkey of vb6 and C#. I tried the code below but nothing happen except to launch a calculator?

    VB Code:
    1. Process.Start("calc.exe");
    2. System.Windows.Forms.SendKeys.Send("3434.00");

    thanks,
    Popskie

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: sendkey

    The problem is that you're not waiting for the Calculator window to appear before sending the key strokes.
    Code:
    Process.Start("calc.exe").WaitForInputIdle();
    System.Windows.Forms.SendKeys.Send("3434.00");
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

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