Hello:
I need to pass/update/set an ErrorProvider. Here is my case:
I have a MDIParent that calls a MDIChild. The MDIChild has Controls for the Enter and Leave Events for all TextBoxs. The Leave Event in the Control calls a Class that will do the validation. In the ClassValidation I can use the
((TextBox)sender).Focus(); to set the focus to the invalid TextBox (It works fine).
Is there a way I can set the ErrorProvider in sort of the same way?
Something like this: ???
_______.errorProviderICEPack.SetError(((TextBox)sender), TheError);
Where the _______ is the name of the Form that the control was called from.
Loading
GustavoPosted May 6, 2010, 11:07 AM
Interesting... Not sure where to put or pass the code, but I will play with it. Will get back to you if I have questions or if I get it to wrok. Thanks.
Jaish MathewsPosted May 6, 2010, 10:21 AM
Hi,
What about below by passing error provider?
public void MyValidation(Control ctrl, ErrorProvider errorProvider)
{
errorProvider.SetError(ctrl, "Wrong");
}
and calling like below
cls.Test(textBox1, this.errorProvider1);