|
-
Mar 9th, 2005, 10:11 AM
#1
Thread Starter
Addicted Member
[Resolved]Using webbrowser with Sendkey
i am using the Webbroswer control to open mail.yahoo.com , but when i tried to sendkeys to mail.yahoo.com , nothing happens , the cursor wasn't in the textbox .
but however when i use shell to use internet explorer to open mail.yahoo.com(note a new internet explorer windows will be open) , i am able to send keys to login for me ?
So any one had any idea between Shell and Webbrowser control ?
Last edited by GOBI; Mar 11th, 2005 at 12:10 PM.
-
Mar 9th, 2005, 12:43 PM
#2
Fanatic Member
Re: Using webbrowser with Sendkey
Don't use SendKeys when filling in data in the WebBrowser control; it's unreliable. Check out the articles in my signature, especially the second one.
Author for Visual Basic Web Magazine
-
Mar 10th, 2005, 08:20 AM
#3
Thread Starter
Addicted Member
Re: Using webbrowser with Sendkey
 Originally Posted by TheVader
Don't use SendKeys when filling in data in the WebBrowser control; it's unreliable. Check out the articles in my signature, especially the second one. 
hmm.. thnxs for the replies but after going through the 2nd articles in your signature , i notice that the 2nd article talk about creating a browser but did not say anything on filling values to a webpage like mail.yahoo.com or something similar like sendkeys .
-
Mar 10th, 2005, 06:49 PM
#4
Fanatic Member
Re: Using webbrowser with Sendkey
I don't know exactly what you want to fill in, but in the second article I advocated the use of the Document Object Model to manipulate pages. If, for example, you want to insert text in the first textbox on the page, you can use this code: 
VB Code:
WebBrowser1.Document.getElementsByTagName("input").item(0).value = "text"
Author for Visual Basic Web Magazine
-
Mar 11th, 2005, 12:08 PM
#5
Thread Starter
Addicted Member
Re: Using webbrowser with Sendkey
 Originally Posted by TheVader
I don't know exactly what you want to fill in, but in the second article I advocated the use of the Document Object Model to manipulate pages. If, for example, you want to insert text in the first textbox on the page, you can use this code:
VB Code:
WebBrowser1.Document.getElementsByTagName("input").item(0).value = "text"
Thanks , i guess i nid to read through ur article more clearly to understand it , but one last question how do u know of all the methods and attributes that is in the document ? cos i realise mine vb 6 does not show have any drop down when i enter the webbrowser1.document. so i thought the code doesn't work at 1st ? anyway thumbs up for the help
-
Mar 11th, 2005, 02:12 PM
#6
Fanatic Member
Re: [Resolved]Using webbrowser with Sendkey
In this section of MSDN you can find all methods and properties that you can use.
Author for Visual Basic Web Magazine
-
Mar 12th, 2005, 12:32 PM
#7
Thread Starter
Addicted Member
Re: [Resolved]Using webbrowser with Sendkey
seems to be abit like html but 1 last question is that is it possible to use it to "fire/press enter" on a specific command button .
-
Mar 12th, 2005, 02:55 PM
#8
Fanatic Member
Re: [Resolved]Using webbrowser with Sendkey
It is HTML... At least, it's a way to crawl through an HTML page.
You can use the Click method on a command button to programmatically click it.
VB Code:
WebBrowser1.Document.getElementsByTagName("button").item(0).Click
Author for Visual Basic Web Magazine
-
Mar 14th, 2005, 09:07 AM
#9
Thread Starter
Addicted Member
Re: [Resolved]Using webbrowser with Sendkey
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|