Question

I'm using the ErrorProvider class to display an error icon next to some text controls I have on a form. I see that it's possible to set the place where the error icon will show up using the SetIconAlignment method. But is it possible to specify the position of the error icon (relative to a control's position)? I need to do this because I have text on the right of my control and a number on the left. I would like the error icon to show up either after the text or before the number and not between the number and the textbox or between the textbox and the text.

Was it helpful?

Solution

Use the SetPadding() method to adjust the space between the control and the icon.

Do note that it isn't very common to call this method directly, you can set it in the designer. Select the control that requires the tweak and change the "IconPadding on Xxx" property.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top