Added offset option to color button

This commit is contained in:
Jaex 2018-04-18 05:20:41 +03:00
parent a0255f95a6
commit 5a03d45363

View file

@ -51,6 +51,8 @@ public Color Color
} }
} }
public int Offset { get; set; } = 3;
[DefaultValue(false)] [DefaultValue(false)]
public bool ManualButtonClick { get; set; } public bool ManualButtonClick { get; set; }
@ -84,9 +86,8 @@ protected override void OnPaint(PaintEventArgs pevent)
{ {
base.OnPaint(pevent); base.OnPaint(pevent);
int offset = 3; int boxSize = ClientRectangle.Height - Offset * 2;
int boxSize = ClientRectangle.Height - offset * 2; Rectangle boxRectangle = new Rectangle(ClientRectangle.Width - Offset - boxSize, Offset, boxSize, boxSize);
Rectangle boxRectangle = new Rectangle(ClientRectangle.Width - offset - boxSize, offset, boxSize, boxSize);
Graphics g = pevent.Graphics; Graphics g = pevent.Graphics;