Question Toolstripbutton not validating textbox.

priyamtheone

Well-known member
Joined
Sep 20, 2007
Messages
96
Programming Experience
Beginner
I have a textbox, a standard button and a toolstrip containing a couple of buttons.
In the validating event of the textbox i coded to check whether it is blank.
If yes then it shows a message 'Enter Value'. When the standard button is clicked while the textbox is empty, it's validating properly and showing the message but when the toolstripbutton is clicked it's not not validating the textbox and no message is being shown. It seems that I gotto write the validation code explicitly in the toolstripbutton_click event which is too troublesome when there are multiple textboxes and toolstripbuttons on a single form. What I want to know is whether the
textbox_validating can be fired while the toolstripbutton is clicked?
Handling toolstrips is really a headache.
Please help. I'm badly in need of it. Regards.
 
You mention the validating event of the textbox at first, but then go on to write about the Button and ToolStripButton click events. I'm not sure what you are trying to do here. Realize that the validating event of a control happens just after the control's Leave event.

Showing code (wrapped in code blocks) always helps.
 
Back
Top