Reputation: 13
I added a krypton button to a form, on the commonstate i added and image also set aligne to left-center before the text.
But i cannot finding padding option to push the image away from the left edge of the button.
Please, is there away i can do this?
Upvotes: -2
Views: 125
Reputation:
Unfortunately it is not possible to add padding specifically to an image thorugh a property like Padding
or ImagePadding
.
If you want to, you can try overriding the button's OnPaint
method and manually draw the image and text with your spacing.
Basic Example:
public class MyCustomKryptonButton : KryptonButton
{
protected override void OnPaint(PaintEventArgs pevent)
{
base.OnPaint(pevent);
int imgPaddingLeft = 10;
int imgPaddingTop = 10;
if (this.Values.Image != null)
{
pevent.Graphics.DrawImage(this.Values.Image, new Point(imgPaddingLeft, imgPaddingTop));
}
}
}
Upvotes: 0