Simple way to force a form to validate

  • Thread starter Thread starter Giri
  • Start date Start date
G

Giri

Is there a simple way to force a form to invoke validation on all its
controls.. I want to do this on a button_click prior to doing some
processing..

Thanks
 
Is there a simple way to force a form to invoke validation on all its
controls.. I want to do this on a button_click prior to doing some
processing..
Not that I can think of. Once common idiom for form validation is to use an Error Provider. Set the text on the error provider for a control that does not validate (of course don't cancel hte kill focus). Then when you need to validate the form iterate over the controls on the form , and pass them to the error providers GetError() method to determine if any error text has been set against it.
Ian Cooper
wwww.dnug.org.uk
 
Back
Top