G
Guest
I am writing a windows application based on a set of generic user controls
that I have developed.
I have a user control called "ctlInputText" that has a label, textbox and
error provider. The error provider is used to ensure that the text box is
completed. There is a property that can be set in the control that disables
the validation so that the control can also be used for situations where the
text box is optional.
My problem is this. I have put 2 of these controls onto a dialog form. The
first control does not require validation, but the second control does. If I
click OK on the form when the focus is on the control that does not require
validation then the dialog closes WITHOUT doing validation on the second box
- this is ofcourse not what I want.
How do I get the form to validate each control when I click the OK button,
not just the control that has focus. Alternatively is there a way that I can
validate the whole form when it is loaded, causing all of the controls that
require dataentry to be flagged with the little icon thing?
Thanks in advance
Huw
that I have developed.
I have a user control called "ctlInputText" that has a label, textbox and
error provider. The error provider is used to ensure that the text box is
completed. There is a property that can be set in the control that disables
the validation so that the control can also be used for situations where the
text box is optional.
My problem is this. I have put 2 of these controls onto a dialog form. The
first control does not require validation, but the second control does. If I
click OK on the form when the focus is on the control that does not require
validation then the dialog closes WITHOUT doing validation on the second box
- this is ofcourse not what I want.
How do I get the form to validate each control when I click the OK button,
not just the control that has focus. Alternatively is there a way that I can
validate the whole form when it is loaded, causing all of the controls that
require dataentry to be flagged with the little icon thing?
Thanks in advance
Huw