We use derived Form-Classes, with one base form class for our software.
On the derived forms we use DataBinding extensively to deal with our BusinessObjects, all implementing IDataErrorInfo, throwing custom error-messages on false inputs to the GUI with ErrorProviders.
I now search for a way to implement a function in the base-form-class to get all ErrorProvider-Components on a Form and set the IconAlignment for every Control on the Form to left (since right is a spacing-problem).
Any Hints welcome...
Code for Setting the IconAlignment:
private void SetErrorProviderIconAlignment(ErrorProvider errorProvider, Control control)
{
errorProvider.SetIconAlignment(control, ErrorIconAlignment.MiddleLeft);
foreach (Control subControl in control.Controls)
{
SetErrorProviderIcon(errorProvider, subControl);
}
}