I’ve form with eight textboxes, and and now I want whenever any user performs textchanged event in any textbox, a button gets disabled.
Should I need to bind to textChanged event to all the textboxes, or is there any better approach?
What if later I want more textboxes in my winforms?
If for some reason you don’t want to have to bind the same event handler to 8+ text boxes in the designer, you could do so programatically on the Form load event:
The only problem with this is that if any of the TextBoxes are inside another control, you’ll need to write a recursive find method like this:
You can call that method on a form, so the original code will become: