Sign in to follow this  

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

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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 this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this