Is the built-in validation useless or is it just me?

  • Thread starter Thread starter Henke
  • Start date Start date
H

Henke

Suppose you have a form with some texboxes and a save button. Alla textboxes
must contain some text before saving the "record" is possible. I try to
solve this by using the ErrorProvider control. Everything works just fine if
the user set the focus on a textbox and then trying to leave it, but it is
still possible to press the save button if no of the textboxes ever have had
focus.
How can I prevent the user from trying to save the record right after the
form has been displayed and the user havn't set focus to any of the
textboxes?

Thanks!
/Henke
 
* "Henke said:
Suppose you have a form with some texboxes and a save button. Alla textboxes
must contain some text before saving the "record" is possible. I try to
solve this by using the ErrorProvider control. Everything works just fine if
the user set the focus on a textbox and then trying to leave it, but it is
still possible to press the save button if no of the textboxes ever have had
focus.
How can I prevent the user from trying to save the record right after the
form has been displayed and the user havn't set focus to any of the
textboxes?

You may want to call the form's 'Validate' method.
 
I tried calling the Validate-method but no of my Validating or Validated
event handler gets called. My controls are placed on a user control that is
placed on a form.
Any ideas?

/Henke
 
Back
Top