Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the form border color c#?

I would like to change window form border color (the border with the form title). The example I found in codeplex is too much and confusing. Can any help me on something simpler?

like image 233
don Avatar asked Sep 18 '09 16:09

don


2 Answers

Workaround - Just follow these steps:

  • Set FormBorderStyle to None.
  • Cover the form with a panel and leave some space for border.
  • Set the color you want for the border as the form back color.

Now, the panel serves as the main container and you can change the background as you want and the form serves as the border.

The Final Result

enter image description here

like image 167
Essam Fahmi Avatar answered Sep 19 '22 22:09

Essam Fahmi


Override it with:

protected override void OnPaint(PaintEventArgs e)
{
    ControlPaint.DrawBorder(e.Graphics, ClientRectangle, Color.[your_color], ButtonBorderStyle.Solid);
}
like image 45
paraJdox1 Avatar answered Sep 19 '22 22:09

paraJdox1