Validating Problem

  • Thread starter Thread starter mehdi
  • Start date Start date
M

mehdi

Hi folks,
Consider a UserControl (containg a textbox, and 2 buttons) that's being
placed in a windows form. The AutoValidate property is set to Disable,
for the form. However, the same property is set to
EnablePreventFocusChange for the contained UserControl.

The problem is that when I try to move between the controls within the
UserControl using the TAB key, the validating event is not called. Why
is that?

Any help would be highly appreciated,

Cheers,
Mehdi
 
Hi Mehdi,

You have explicitly disabled validation on the container control (Form), which apparently takes precedence. You can manually
Validate your controls by calling ValidateChildren().
 
Back
Top