Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems when using IconAlignment with WinForms ErrorProvider

Tags:

c#

winforms

I have a ComboBox that has an associated ErrorProvider in the user control it belongs to. When an error happens, I want to display an icon on the left of the combo.

However, no matter what value I set as IconAlignment for my combo, the icon gets displayed on the right. Do you guys have any idea what could be wrong here?

Thanks for any help.

like image 833
Irina Avatar asked Nov 27 '25 08:11

Irina


1 Answers

If you call Clear() method of ErrorProvider, it resets the IconAlignment of the associated controls.

You can use ErrorProvider's SetError(control, String.Empty) instead to clear the error for the ComboBox.

like image 72
Borislav Ivanov Avatar answered Nov 29 '25 22:11

Borislav Ivanov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!