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 be Flat
  • In the FlatApperanace set BorderSize to 0
  • In the FlatApperanace set MouseOverBackColor to ControlLight

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:

enter image description here