I put a webbrowser control in my windows form application and I would like my visual basic.net script to know if a button is clicked inside the webpage that is loaded by the webbrowser control. I suppose there must be a way to do this, so far I know how to access document elements by ID but i dont know how to know if their events are fired. thanks for your help!
Imports Gecko
Public Class Form1
Public myBrowser As GeckoWebBrowser
Public Sub New()
InitializeComponent()
Gecko.Xpcom.Initialize("c:\xulrunner")
myBrowser = New GeckoWebBrowser()
myBrowser.Parent = Me
myBrowser.Dock = DockStyle.Fill
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
myBrowser.Navigate("example.com")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' MessageBox.Show(myBrowser.Document.GetElementById("divID").TextContent())
End Sub
Private Sub divclick(ByVal sender As Object, ByVal e As EventArgs) Handles myBrowser.Document.GetElementById("divID").Click
'codes that i need to be run
End Sub
End Class