Jump to content
  • Advertisement
Sign in to follow this  
BTownTKD

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

This topic is 3629 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!