sendkeys and focus

Ok i got a bit of a prob. i'm tryin to make vb type in a webbrowser thing tht i got onscreen in a vb form. my friend suggested send keys but you have to set a focus to the webbroweser or somethin like tht. i tried everything he's said but i've had no luck. can anyone out there help me

 

if u didn't get tht, i want vb to type in a webbrowser bit which is in my form when i click a button.

 

ok a bit of an update here. i tried what my friend said again except with a textbox. tht worked. But i tried the exact same thing except with my webbrowser and it doesn't work. Why not and how can i fix it so it will




Answer this question

sendkeys and focus

  • _anna

    i want it to type in the web page when i click a button



  • Mert Torun

    OK!!!!!!!!

    Now we're cooking. You've formed up your question and now we know what you want.

    I hope you don't think I'm being dismissive or leaing you on but... There are two perhaps three ways to do this.

    I'm ashamed but I've never done it the simple way (sendkeys) and am not sure how to do. I've done it in very complex ways using httpweb request and POST. That's not really suitable here.

    But I can help you with your nomenclature. Overall you want to do an automated post into a page HTML Element called an input box. What I think you asking is, how do I put text into a web page textbox.

    A couple of things come into play.... that input box has to have Focus and that's managed by controlling the webrowser. You are either going to have to write one where you can control the focus (DOM programming is an intermediate level skill) and then use sendkeys, or you are going to have to set the focus manually which rather defeats you purpose doesn't it



  • never.1981.m.ph

    here's what i've got

    Private Sub Command1_Click()
    WebBrowser1.SetFocus
    SendKeys "hi"
    End Sub

    why doesn't tht work



  • Hugh Potts

    i want hi to go on a web page which i've got showing in my program using a webbrowser function. i want to click a button and for "hi" to appear on the page (in one of those littlr input things on a webpage)



  • Bob DuPuy

    We can't help you with VB6 problems, Col. I'm terribly sorry.

    Please download VBExpress and we'll continue talking.



  • Kiran Math

    yeah i've tried doing tht

    i've set the foucus on the webbrowser but my text doesn' appear.

    i've also tries automated mouse movements and clicking on the window and doing send keys.

    but this is the weird bit.

    if i do text1.setfocus and then do sendkeys it works.



  • gypsy66

    OK, now then.... where do you want "hi" to go Where do you want to put in it In what



  • adavis2

    ok, because setfocus isn't working at selecting my webbrowser. what does i want to type in my webpage!!!

  • Brad Alexander

    It would be helpful if you could clarify your desired functionality.



  • skinned_knuckles

    Come on all u Vb people. I need ur help!!!

    plz



  • GaryHend

    i want VB to type in the web page on my form when i click a button.

  • j.

    text 1 is anougher thing i added to see if sendkeys actually worked.

  • Ha Duo

    Now I'm confused.... where is text1 where you are setting the focus I thought you wanted the output in a webrowser where there is no Text1



  • nedde

    Here's where my question comes in....

    What does "it" refer to



  • sendkeys and focus