A
Andre Rode
Hi,
since I solved my last problem with the help of this ng, I've got new
stuff to solve
First: I'm new to creating own events, until now I only got to work with
pre-defined events.
I'm using a virtual webbrowser, this means there's no form containing a
webbrowser element. I want to run this within a DLL.
But I'm not able to get the event Document_completed working. When the
browser.navigate is called, he never jumps into document_completed. It
seems I just declared the event in a wrong way.
doSomething is the sub called from outside the dll.
Here's the code:
Public Class myclass
Dim mybrowser As Windows.Forms.WebBrowser
Public Event mbDocumentCompleted As & _
Windows.Forms.WebBrowserDocumentCompletedEventHandler
Public Sub doSomething()
mybrowser = New Windows.Forms.WebBrowser
AddHandler mybrowser.DocumentCompleted, AddressOf
Document_Completed
[some code]
mybrowser.Navigate("https://www.somesite.com")
end sub
Private Sub Document_Completed() Handles Me.mbDocumentCompleted
[This should happen]
End Sub
End Class
Hope you can help me,
greetings from Germany,
André
since I solved my last problem with the help of this ng, I've got new
stuff to solve
First: I'm new to creating own events, until now I only got to work with
pre-defined events.
I'm using a virtual webbrowser, this means there's no form containing a
webbrowser element. I want to run this within a DLL.
But I'm not able to get the event Document_completed working. When the
browser.navigate is called, he never jumps into document_completed. It
seems I just declared the event in a wrong way.
doSomething is the sub called from outside the dll.
Here's the code:
Public Class myclass
Dim mybrowser As Windows.Forms.WebBrowser
Public Event mbDocumentCompleted As & _
Windows.Forms.WebBrowserDocumentCompletedEventHandler
Public Sub doSomething()
mybrowser = New Windows.Forms.WebBrowser
AddHandler mybrowser.DocumentCompleted, AddressOf
Document_Completed
[some code]
mybrowser.Navigate("https://www.somesite.com")
end sub
Private Sub Document_Completed() Handles Me.mbDocumentCompleted
[This should happen]
End Sub
End Class
Hope you can help me,
greetings from Germany,
André