It seems that I've got to write the validation code explicitly in the The Tool Strip Item classes are special, they don't derive from Control.One side-effect of that is that they don't take the focus away from the active control.For instance, for a digit check you could do: You must give a look at Masked Text Box control.It requires you to set a mask for the required valid input on a textbox.
It may not meet the security requirements for a specific environment, and it should not be used exactly as shown.
The Format event on a data binding can be used to reformat incoming data to comply with the mask, and the Parse event can be used to reformat outgoing data to comply with the specifications of the data field. If you want full programmatic control over validation, or need to perform complex validation checks, you should use the validation events built into most Windows Forms controls.
Each control that accepts free-form user input has a Validating event that will occur whenever the control requires data validation.
Since you said you have a lot of textboxes to validate, you might want to consider making a Validate() function that returns true or false and checks all of the textboxes.
Then all you have to do is check if Validate() = true and call the same function from all of your toolstrip buttons instead of copying the same code over and over again.