• 13
• 15
• 19
• 27
• 9

[.net] Forms & Events - how to catch any child control being changed?

This topic is 3538 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hey all - I have a form that contains multiple controls (obviously) and I have a small text box at the bottom, which I would like to update any time ANY of the controls are changed within the window. Is there some kind of catch-all event that gets posted, any time a control is changed within a form? Thanks, -Brian p.s. My alternative is to use a timer, which updates the textbox every few milliseconds; it's supposed to be kind of a "live preview."

Share on other sites
No, there's not. Just create a function and assign the specific event for each control to it. Most of the events you'll want to capture are pretty standard in their signature:

private void ControlChanged(object sender, EventArgs e){   //check the type of control here and the correct property for that type of control}

If a specific type of control has a different signature, create a function for that control type and have it call this one.

Quote:
 p.s. My alternative is to use a timer, which updates the textbox every few milliseconds; it's supposed to be kind of a "live preview."

No, no, no, no, no!

Share on other sites
Quote:
 Original post by MachairaNo, no, no, no, no!

Lol.

Thanks!