开发者

How can I call the Control color, I mean the default forms color?

For instance, to make something blue I would go:

this.BackColor = Color.LightBlue;

How can I s开发者_开发百科ummon the Control color, the khaki one.

Thanks SO.


The System.Drawing.SystemColors class has properties exposing the various system colours, so you can do

this.BackColor = SystemColors.Control;

The full range of properties to access other colours is listed on MSDN.


I haven't tested this, but I believe it to be:

this.BackColor = Control.DefaultBackColor;


this.BackColor = default(Color);

Seems to be the color that the form designer uses...


Another way for example is to use the Transapernt to set the color of control Parent

this.BackColor = Color.Transparent;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜