Sets the background color of the control
#include <GuiListView.au3>
_GUICtrlListView_SetBkColor ( $hWnd, $iColor )
$hWnd | Control ID/Handle to the control |
$iColor | Background color to set or CLR_NONE value for no background color - see Remarks below |
Success: | True. |
Failure: | False. |
Color must be in BGR format - use _WinAPI_SwitchColor() to convert from RGB format.
#include <ColorConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $idListview
GUICreate("ListView Get/Set BkColor (v" & @AutoItVersion & ")", 400, 300)
$idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
GUISetState(@SW_SHOW)
; Set colors
_GUICtrlListView_SetBkColor($idListview, $CLR_DARKSEAGREEN)
_GUICtrlListView_SetTextColor($idListview, $CLR_BLACK)
_GUICtrlListView_SetTextBkColor($idListview, $CLR_DARKSEAGREEN)
; Add columns
_GUICtrlListView_AddColumn($idListview, "Items", 100)
; Add items
_GUICtrlListView_BeginUpdate($idListview)
For $iI = 0 To 10
_GUICtrlListView_AddItem($idListview, "Item " & $iI)
Next
_GUICtrlListView_EndUpdate($idListview)
; Show colors
MsgBox($MB_SYSTEMMODAL, "Information", "Back Color ....: " & _GUICtrlListView_GetBkColor($idListview) & @CRLF & _
"Text Color ....: " & _GUICtrlListView_GetTextColor($idListview) & @CRLF & _
"Text Back Color: " & _GUICtrlListView_GetTextBkColor($idListview))
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example