How can I set a form's backcolor to a custom color (such as light pink) using C# code?
+2
A:
With Winforms you can use Form.BackColor to do this.
From within the Form's code:
BackColor = Color.LightPink;
If you mean a WPF Window you can use the Background property.
From within the Window's code:
Background = Brushes.LightPink;
Brian R. Bondy
2010-05-23 12:32:05
A:
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
MusiGenesis
2010-05-23 12:38:31
Thanks! much appreciated
jimmy
2010-05-23 12:52:34