Validating Problem

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
 
D

Dave Sexton

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().
 

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