如何以编程方式更改WinForm控件的文本颜色? [英] how to change WinForm controls' text color programatically?

查看:203
本文介绍了如何以编程方式更改WinForm控件的文本颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能告诉我如何以编程方式更改WinForm控件的文本颜色吗?我没有问题找到要分配颜色的字段,但编译器不会识别我提到的任何颜色,无论是像WindowText,还是类似Red的东西。


BTW,我正在使用VC#Express 2008.

Can anybody tell me how to change WinForm controls'' text color programatically? I have no problem finding the fields to assign colors to, but the compiler doesn''t recognize any color I mention, whether it''s something like WindowText, or something like Red.

BTW, I''m using VC# Express 2008.

推荐答案

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | Wrap | 行号


注意,tlhintoq:


谢谢,但是如何让控制文本重新显示,以便您可以看到您对文本颜色所做的更改?我已经尝试按照您的建议更改文本颜色了,我已经尝试过了,再加上重新分配文本字段中的字符串,但这不起作用。
attention, tlhintoq:

Thanks, but then how do you get the control text to redisplay so you can see the change you''ve made to the text color? I''ve tried changing the text color as you recommended, and I''ve tried that plus reassigning the string that goes in the text field, but that isn''t working.


展开 | 选择 | Wrap | 行号


这篇关于如何以编程方式更改WinForm控件的文本颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆