C# winforms button with solid border, like 3d
You can customize the Button
control this way have thick 3d borders:
- Set the Button
FlatStyle
to beFlat
- In the
FlatApperanace
setBorderSize
to0
- In the
FlatApperanace
setMouseOverBackColor
toControlLight
Then handle Paint
event and using ControlPaint.DrawBorder
draw a thick 3d border:
private void button1_Paint(object sender, PaintEventArgs e)
{
ControlPaint.DrawBorder(e.Graphics, button1.ClientRectangle,
SystemColors.ControlLightLight, 5, ButtonBorderStyle.Outset,
SystemColors.ControlLightLight, 5, ButtonBorderStyle.Outset,
SystemColors.ControlLightLight, 5, ButtonBorderStyle.Outset,
SystemColors.ControlLightLight, 5, ButtonBorderStyle.Outset);
}
And here is the result: