I have multiple TextBoxes and whenever they lose focus / another box receives focus, I want their content to be validated. For example if I jump to the next textbox using tab or mouse.
Each of the textboxes has an event handler.
this.textBox.Validating += new System.ComponentModel.CancelEventHandler(this.textBox_Validating);
textBox.CausesValidation
is true. So it should cause validation when it receives focus.
Yet none of the TextBoxes fires its validating event. The event handler is not called.
What am I missing? I have no issues handling other events.
The AutoValidate
property of the parent UserControl was set to Systems.Windows.Forms.AutoValidate.Disable
This disables automatic validation on focus change.