I am converting a C# program to VB,Net. The conversion created the following line:
Me.axWebBrowser1.DocumentCompleted += New Windows.Forms.WebBrowserDocumentCompletedEventHandler(AddressOf Me.axWebBrowser1_DocumentComplete)
Error 17 'Public Event DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
You're not trying to raise the event, you're trying to subscribe to it.
In VB.NET this is done using an AddHandler statement:
AddHandler Me.axWebBrowser1.DocumentCompleted, AddressOf Me.axWebBrowser1_DocumentComplete
Also a statement isn't located inside a class, namespace or library. A statement is a line, or multiple lines, of code that goes together. So, not related to your problem, but you can read about the RaiseEvent statement.