Customizing WinForms ErrorProvider to display its icon inside control's entry

Jarek picture Jarek · Jul 15, 2009 · Viewed 8.8k times · Source

I have some custom/user controls that in most cases have label and entry, like this:

removed dead ImageShack link

Is there any way I can customize the standard WinForms ErrorProvider to display its icon inside entry (entry - textbox, combo, datetime etc...), like this:

removed dead ImageShack link

where the red circle is of course the error indicator.

Thanks for any help.

Answer

Jarek picture Jarek · Jul 16, 2009

I've found a solution:

this.errorProvider.SetIconPadding(this.textBox, -20);

where errorProvider is an ErrorProvider Object and textBox is an Entry object.