You might even loop through all the controls on your form and focus each of them individually (or an individual control by giving it focus then changing the focus to another control), achieving the same effect: Which solution is better?
event, but how do I actually tell Visual Basic 'Pretend someone has clicked the button and fire this event'?
events are hierarchical and will cascade up and down the parent chain until the appropriate control is reached.
For example, assume you have a Form with two Group Box controls, and each Group Box control has one Text Box control.
Hi All, I am writing a simple win form which contains a button, when user click the button i want to validate all the other textbox and see if there is anything goes wrong may i know how can i trigger the validating event for all text box? thx and regard,s Norton Norton, It sounds for me as a horse behind the car.
thx and regard,s Norton Norton, I got the following tip from "Windows Forms Programming in C#" by Chris Sells, from Addison Wesley. How can something be wrong in a textbox when you use correct the validating event.
This might be a common scenario in data entry forms where you might create a new record and the user might not touch all the fields on your form (and thus never trigger the “Validating” event of your controls). One, pointed out by Chris Sells (read more), invokes the Control's “Notify Validating” event through Reflection.