设置背景颜色
#Include <GuiStatusBar.au3>
_GUICtrlStatusBar_SetBkColor($hWnd, $iColor)
$hWnd | 控件句柄 |
$iColor | 新的背景颜色.指定 CLR_DEFAULT , 使状态栏使用默认背景颜色. |
返回以前的背景颜色,如果为默认背景颜色,则返回 CLR_DEFAULT |
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
#include <Constants.au3>
$Debug_SB = False ; 检查传递给函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
_Main()
Func _Main()
Local $hGUI, $hStatus
Local $aParts[3] = [75, 150, -1]
; 创建 GUI
$hGUI = GUICreate("(Example 1) StatusBar Set BkColor", 400, 300)
$hStatus = _GUICtrlStatusBar_Create($hGUI)
GUISetState()
; Set parts
_GUICtrlStatusBar_SetParts($hStatus, $aParts)
_GUICtrlStatusBar_SetText($hStatus, "Part 1")
_GUICtrlStatusBar_SetText($hStatus, "Part 2", 1)
; Set background color
_GUICtrlStatusBar_SetBkColor($hStatus, $CLR_MONEYGREEN)
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main