如何更改WinForm按钮的文本颜色?

6

我想知道是否可以改变WinForm按钮文本的颜色。我查看了字体属性,但找不到任何东西,但我认为像这样简单而(在我的想法中)实用的东西应该是可能的...

4个回答

8
你需要使用从 Control 继承的按钮的 ForeColor 属性。请参见 此链接

0
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);

1
谢谢提醒,这是我的第一条评论。这样可以吗? - Nelson Martins

0

0
请看一下按钮的 ForeColor 属性。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接