Library code snippets
Advancing the Webbrowser Control
By Kym Manson, published on 29 Mar 2002
You need to have "HTML Object Library" in the References window, and a webbrowser control (Microsoft Internet Controls). Once you've inserted this code into your project, you'll notice a new object in the Code window called mdocDocument. It has lots of events, such as: Click, Double Click, Mouse Move, KeyUp, KeyDown and lots more...
Place the following code in the General Declarations section
Private mhtmDoc3 As IHTMLDocument3
Private WithEvents mdocDocument As HTMLDocument
' When navigating to a new page, update the Object we're monitoring
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
Set mhtmDoc3 = WebBrowser1.Document
Set mdocDocument = mhtmDoc3
End Sub
Related articles
Related discussion
-
Problem with migration to C# (CoCreateInstanceEx)
by LRollison (1 replies)
-
VB6 Problem Creating Shortcuts
by rb1177 (0 replies)
-
how can i open a file
by kyawswarhtun (0 replies)
-
how to save any one form what i want?
by blackguy (5 replies)
-
Build an MP3 Player
by soybees (4 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Click a link: Browser1.Navigate "javascript:document.links[1].click();"
Submit a form: Browser1.Navigate "javascript:document.formName.submit();"
If you read more about the DOM and javascript you can do almost anything using the browser control. You can experiment with this javascript by just typing it into the address bar.
This thread is for discussions of Advancing the Webbrowser Control.