简体   繁体   English

更改WinForm按钮的文本颜色?

[英]Changing WinForm Button Text Color?

I'm wondering if it's possible to change the color of a WinForm Button's text. 我想知道是否可以更改WinForm Button文本的颜色。 I'm looking at the font properties, and can't find anything, but I feel like something as simple and (in my mind) practical as this should be possible ... 我正在查看字体属性,什么也找不到,但是我觉得这很简单,而且(在我看来)可行,因为这应该是可能的...

You need the ForeColor property of the button, inherited from Control . 您需要继承自Control的按钮的ForeColor属性。 See this link . 看到这个链接

使用ForeColor属性。

看一下按钮ForeColor属性

Button btn = new Button();
//in this situation text color it will be black, for white 255,255,255
btn.Forecolor = System.Drawing.Color.FromArgb(0,0,0);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM