Simple way to force a form to validate

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
 
I

Ian Cooper

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top