November 23rd, 2010, 10:21 AM
[RESOLVED] Toolstripbutton not validating textbox.
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.
March 30th, 2014, 11:32 AM
Re: Toolstripbutton not validating textbox.
While clicking any toolstrip button just validate the entire for before calling any method. This way it'll fire the textbox validating event.
// Call your method.
Click Here to Expand Forum to Full Width