By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,201 Members | 937 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,201 IT Pros & Developers. It's quick & easy.

List of events handled by control

P: n/a
Hi All,

Is there any way to get the list of events that a particular control
handles, so they can be added or removed dynamically?

In other words, say I have a TreeView that handles the AfterLabelEdit,
BeforeLabelEdit, and ItemDrag events (just to use some events as an example).

If I remove this tree control programatically, and then add it back in with
a different parent, I've lost the event handlers. I'd like to recreate these
dynamically, from a list of event handlers that was created before the remove.

Obviously, the event handlers could be hard-coded in where the control is
added, but that is certainly error prone. For example, if the KeyDown event
is added later, chances are probably 50/50 that somebody will add the event
handler code to the place where the control is re-added.

Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.