I have a form with a GroupBox
and an ErrorProvider
. When I try to use the following code:
errorProvider1.SetError(groupBox1, "error");
The error icon is shown to the right of the group box:
I would like the icon to be shown next to the header. Something like this (made with Photoshop):
How can I achieve that?
2
Answers
You can use
SetIconAlignment
andSetIconPadding
to set the location of the error icon. For example:You need to shift the text a bit to right, by preppending some space, to have more room for the icon.
Following should help you.
As explained in your previous question regarding TabControl, you would need to provide sufficient space in your GroupBox Text for showing the icon