Sunday 15 May 2011

.net - Is there an easy way to add an event to all form objects in C# -


I have a form with many labels and text boxes, if any area has been modified then I Would you like to highlight that is an easy way to do this or do you need to individually add event callback to each form object? Thanks!

From the upper part of my head you can do something like that in the form load event Incorporate incidents ...

  foreach (different controls in this. Control) {If (control is labeled) {(control of the label)). Changed text + = changes after controls; } And if (control is text box) {((text box) control). Change the text + = ControlsTextChanged; }}    

No comments:

Post a Comment