How to add event handlers for controls added at runtime.
-
I am using a third party SNMP component. I create this component at run-time in a C# class. I am wondering if there is someway I can use event handlers for this control in that class.
-
I am using a third party SNMP component. I create this component at run-time in a C# class. I am wondering if there is someway I can use event handlers for this control in that class.
Your thrid party component has to trigger events, once you know it does, you can catch them by for example with a button: btnButton.Click += (and then you press tab and it will create the method for you) When the third party component doens not trigger any events i'm affraid you can't. You can recognize events when you press . and then you get a list of all posible options, when it's a yellow lightening sign it's an event. (this if you use Visual Studio)