Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set form backcolor to custom color

How can I set a form's backcolor to a custom color (such as light pink) using C# code?

like image 704
jimmy Avatar asked May 23 '10 12:05

jimmy


People also ask

How do I change the color of a form in C#?

To change the background color, select the form in Visual Studio and locate the BackColor property in the Properties panel. There are a number of ways to specify a color. Color by name - Simply type in a color name into the BackColor value field (for example Red, Yellow, Cyan etc).


1 Answers

If you want to set the form's back color to some arbitrary RGB value, you can do this:

this.BackColor = Color.FromArgb(255, 232, 232); // this should be pink-ish 
like image 188
MusiGenesis Avatar answered Oct 07 '22 21:10

MusiGenesis