Search code examples
vb.netvisual-studioevent-handlinggeckofx

VB.net Gecko WebBrowser DocumentCompleted not compatible?


I'm using GeckoBrowser, as I find it displays and loads pages faster than the native WebBrowser(IE). The only issue I'm having is when to tell the page has finished loading so I can then run more code.

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        GeckoWebBrowser1.Navigate("http://www.google.com")
    End Sub
    Private Sub GeckoWebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles GeckoWebBrowser1.DocumentCompleted
        Label1.Text = "YES"
    End Sub
End Class

The error I get is "Method 'GeckoWebBrowser1_DocumentCompleted' cannot handle event 'DocumentCompleted' because they do not have a compatible signature.

I've tried changing 'WebBrowserDocumentEventArgs' to 'GeckoDocumentCompletedEventArgs' but that says 'Type - is not defined'.

Any suggestions would be greatly appreciated.


Solution

  • @jmcilhinney's solution worked, just used drop downs at the top. All I really needed was to add Imports Gecko.Events at the top