Hooking up InternetExplorer to a WebBrowser control

  • Thread starter Thread starter Ludwig Wittgenstein
  • Start date Start date
L

Ludwig Wittgenstein

Hi, all.

How can i hook up an InternetExplorer object to a WebBrowser
control that I have in my windows form. Basically what I want to do is
automate the WebBrowser control via the InternetExplorer object
(instead of loading iexplorer.exe externally...).


Thanks,
 
WebBroswer Control is the IE control... you don't need the IE object, what
is your exact intent.
 
I want to have an embedded browser in my winform app that I can run
automated tasks against. For example, I want to load a web page
through the embedded browser and be able to located html tags (by ID
or name) and be able to click them (programmatically). Can you do that
using the WebBrowser control?
I know you can using SHDocVw.InternetExplorer.

Thanks,
 
I want to have an embedded browser in my winform app that I can run
automated tasks against. For example, I want to load a web page
through the embedded browser and be able to located html tags (by ID
or name) and be able to click them (programmatically). Can you do that
using the WebBrowser control?
I know you can using SHDocVw.InternetExplorer.

Thanks,
 
The WebBrowser control is already a wrapper of SHDocVw.InternetExplorer. To
access SHDocVw.InternetExplorer, look at the "WebBrowser.ActiveXControl"
property.

Jon
 
Ludwig Wittgenstein said:
I want to have an embedded browser in my winform app that I can run
automated tasks against. For example, I want to load a web page
through the embedded browser and be able to located html tags (by ID
or name) and be able to click them (programmatically). Can you do that
using the WebBrowser control?

Yes, look at WebBrowser.Document.

Jon
 
Hi, Jon.

Thanks for your reply, I was unable to find any automation methods
for WebBrowser, all I found was grabbing information from the
browser's current document (html), but nothing about automating
clicking something in the document to go to another. Can you please
point me to the actual class methods that can do this.


Thanks a lot!
 
For said automation, you can either introspect the href attribute of an <a>
tag and use the Navigate() method, or in the case of forms you can execute
the submit() method on the form object by calling the InvokeMember("submit")
method on the DOM element.

Jon
 
Back
Top