I have a Form that contains a TabControl and an ErrorProvider. One of the tabs has several textboxes and a button. The textboxes use the Validating event to SetError() if contents are not valid. When the button is pressed, this runs:
bool ok = true;
foreach (Control c in errorProviderDv.ContainerControl.Controls)
{
MessageBox.Show(c.Name);
if (errorProviderDv.GetError(c) != "")
{
ok = false;
}
}
The TabControl is the only control in errorProviderDv.ContainerControl.Controls, even though several errors are set and are displaying in the form.
Am I doing something wrong? Does the ErrorProvider need to be a child of the tab instead of the form?