设置指定控件的文本颜色。
GUICtrlSetColor ( 控件ID, 文本颜色)
参数
| 控件ID | 控件标识符(控件ID),可由 GUICtrlCreate... 函数的返回值获得。 |
| 文本颜色 | RGB 模式颜色值。 |
返回值
| 成功: | 返回值为1。 |
| 失败: | 返回值为0。 |
注意
目前只有 Label 和进度条(Progress)控件可设置颜色。
相关
ColorMode(选项), GUICtrlCreate..., GUICtrlSetBkColor
示例
#include <GUIConstants.au3>
GUICreate("我的 GUI 之颜色设置") ; 创建一个居中显示的窗口
GUICtrlCreateLabel ("my Red label", 10,20)
GUICtrlSetColor(-1,0xff0000) ; 红色
GUISetState ()
; 运行脚本直到窗口被关闭
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend