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