I'm trying to add RoutedEventHandler
to all the TextBoxes
through code, using the following line of code:
this.AddHandler(TextBox.GotFocusEvent, new RoutedEventHandler(textBox_GotFocus));
The code above binds the handler to all the form control on the Window instead of TextBoxes alone. Please can someone
- explain why this happens
- and how to do it right.
Thank you.