C# Winform Add Border to UserControl
Posted on Tuesday, November 22, 2016
|
No Comments
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
int borderWidth = 3;
Color borderColor = SystemColors.AppWorkspace;
ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, borderColor,
borderWidth, ButtonBorderStyle.Solid, borderColor, borderWidth,
ButtonBorderStyle.Solid, borderColor, borderWidth, ButtonBorderStyle.Solid,
borderColor, borderWidth, ButtonBorderStyle.Solid);
}
Source : https://social.msdn.microsoft.com/Forums/windows/en-US/ca9a9df3-c37e-455b-8fae-58d88ed77d90/change-border-around-usercontrol?forum=winformsdesigner