B
babylon
I have a form which contains a TextBox, and a 'submit' button which print
TextBox.Text to console
I added validating eventhandler to check if the Textbox is empty and set the
errorprovider if it is empty
and set CancelEventArgs.Cancel = true to make sure the user input something
however..it seems that the validating event only raised when the textbox is
in focus then lost focus
so if I show the form and click the 'submit' button immediately, the
validatin event will not be raised which means that I cannot make sure the
user entered something to the TextBox...
are there any methods to rise the validating event to the textbox or there
are better ways to handle this?
thx!
TextBox.Text to console
I added validating eventhandler to check if the Textbox is empty and set the
errorprovider if it is empty
and set CancelEventArgs.Cancel = true to make sure the user input something
however..it seems that the validating event only raised when the textbox is
in focus then lost focus
so if I show the form and click the 'submit' button immediately, the
validatin event will not be raised which means that I cannot make sure the
user entered something to the TextBox...
are there any methods to rise the validating event to the textbox or there
are better ways to handle this?
thx!