Adding an event handler to 3rd party form?

pachjo

Well-known member
Joined
Dec 12, 2006
Messages
370
Programming Experience
10+
Is it posible to add an event handler to a from that was designed by a 3rd party?

For example a form is supplied call frmThirdPartyForm and on this form is a textbox called UserInput

when I do this:

dim f as new frmThirdPartyForm

is there now a way to add an event handler for f.UserInput?
 
If UserInput is declared with a scope accessible you can use the AddHandler keyword.
VB.NET:
AddHandler f.UserInput.TextChanged, AddressOf a_TextChanged
For example the default scope VS applies to control on forms and usercontrols is Friend, which means it is accessible within the assembly.

If your thirdparty is compiled to its own class library assembly you can't reach Friend objects from that.
 
Back
Top