Sendkeys (simple question, can't find an answer)

Discussion in 'Code Snippets and Tutorials' started by Fexxel, May 2, 2009.

  1. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    Hey guys whats up, long time no see!
    Anyways... Back to business-
    Sendkeys.... It works in VB6, and VB.net, but the problem is that I need to use sendkeys in a web browser.
    Using common sense I tried:
    Code (Text):
    1. WebBrowser1.SendKeys.Send("x")
    I thought that would send "x" in the web browser.
    Well, it didn't.
    It wasn't a "valid line of code".
    So, how do I sendkeys inside the web browser form?
     
  2. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    You don't. You edit the browser's document structure instead of simulating real key presses.
     
  3. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    D*mnet!
    ...And how exactly do I do THAT?!
     
  4. Dark

    Dark Level IV

    Joined:
    May 29, 2008
    Messages:
    1,042
    Likes Received:
    123
    Location:
    Canada
  5. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    I googled it before I asked what it was. The only answers I found were tutorials on how to navigate a web browser forwards and back.
    Thanks for the attempt to help though Dark...
     
  6. Dark

    Dark Level IV

    Joined:
    May 29, 2008
    Messages:
    1,042
    Likes Received:
    123
    Location:
    Canada
    any time :)