如何创建 webbrowser 控件并将单个 DocumentComplete 事件关联到它?基本上我希望能够重用相同的 DocumentComplete 事件,但由于某种原因,它永远不会停止触发该事件,因此当我处理 webbrowser 对象时,它会停止触发该事件。但我希望能够创建另一个控件并为其重用该事件!
干杯
Dim web1 As New WebBrowser()
AddHandler web1.DocumentComplete, AddressOf DocumentCompleteEventHandler
' Do stuff
RemoveHandler web1.DocumentComplete, AddressOf DocumentCompleteEventHandler
web1.Dispose()
Dim web2 As New WebBrowser()
AddHandler web2.DocumentComplete, AddressOf DocumentCompleteEventHandler
' Do stuff
RemoveHandler web2.DocumentComplete, AddressOf DocumentCompleteEventHandler
web2.Dispose()