C# 如何调用控件颜色,我的意思是默认表单颜色?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1600787/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I call the Control color, I mean the default forms color?
提问by Sergio Tapia
For instance, to make something blue I would go:
例如,要制作蓝色的东西,我会去:
this.BackColor = Color.LightBlue;
How can I summon the Control color, the khaki one.
我怎样才能召唤出控制色,卡其色。
Thanks SO.
谢谢。
采纳答案by stevemegson
回答by pyrocumulus
I haven't tested this, but I believe it to be:
我没有测试过这个,但我相信它是:
this.BackColor = Control.DefaultBackColor;
回答by Sparfy
this.BackColor = default(Color);
Seems to be the color that the form designer uses...
好像是表单设计者使用的颜色...
回答by daniele3004
Another way for example is to use the Transapernt
to set the color of control Parent
另一种方法例如是使用Transapernt
来设置控件的颜色Parent
this.BackColor = Color.Transparent;