Sets the background color
#include <GuiStatusBar.au3>
_GUICtrlStatusBar_SetBkColor ( $hWnd, $iColor )
$hWnd | Handle to the control |
$iColor | New background color. Specify the CLR_DEFAULT value to cause the status bar to use its default background color. |
Returns RGB COLORREF color, color passed in must be BGR Hex color or RGB COLORREF
StatusBar controls cannot be painted if the "Windows XP style" is used. Some themes also prevent the statusbar from colouring - if the function appears not to work try removing the theme using _WinAPI_SetWindowTheme() with empty strings for the parameters.
#include <ColorConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <MsgBoxConstants.au3>
#include <WinAPI.au3>
Example()
Func Example()
Local $hGUI, $hStatus
Local $aParts[3] = [75, 150, -1]
; Create GUI
$hGUI = GUICreate("StatusBar Set BkColor", 400, 300)
$hStatus = _GUICtrlStatusBar_Create($hGUI)
GUISetState(@SW_SHOW)
; 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)
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example