I have a WebBrowser control that is created and added to the form during run-time.
How do I connect this control to subroutine that can handle its events at run-time?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use AddHandler
e.g.
and when you want to get rid of it (and you should get rid of it when you’re done using it)
in your case, you might have something like
assuming you’d created an event handler called HandleDocumentCompleted
Depending on your needs, you could also use the WithEvents keyword when you declare your webbrowser; see the documentation.