views:

291

answers:

2

I am having trouble with background colors in C#. For some reason they are simply not working. Specifically on the System.Windows.Forms.Panel control. Setting the BackColor property does nothing. All I have is gray and all the efforts I have made will not change it. Is there something that could be overriding this? Am I approaching this the wrong way?

A: 

If you want to have the Panel Control the same color as the Form's background color, then you can use this:

myPanel.Parent = this;

... I hope this helps :)

baeltazor
except in compact framework ;)
Stormenet
..True, Thanks for that @Stormenet :)
baeltazor
A: 

I have had instances where controls must have both the foreground and background colors specified, you might want to try setting the foreground color explicitly as well, to see if that works.

JYelton