Function Reference


_GUICtrlListView_SetOutlineColor

Sets the color of the border

#include <GuiListView.au3>
_GUICtrlListView_SetOutlineColor ( $hWnd, $iColor )

Parameters

$hWnd Control ID/Handle to the control
$iColor Color to set the border - see Remarks below

Return Value

Returns the previous outline color.

Remarks

Control must have the $LVS_EX_BORDERSELECT extended window style set
Color must be in BGR format - use _WinAPI_SwitchColor() to convert from RGB format.

Related

_GUICtrlListView_GetOutlineColor

Example

#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
        GUICreate("ListView Get/Set Outline Color (v" & @AutoItVersion & ")", 400, 300)
        Local $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
        GUICtrlSetStyle($idListview, $LVS_ICON)
        ; Enable extended control styles
        _GUICtrlListView_SetExtendedListViewStyle($idListview, $LVS_EX_BORDERSELECT)
        GUISetState(@SW_SHOW)

        ; Load images
        Local $hImage = _GUIImageList_Create()
        _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0xFF0000, 16, 16))
        _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x00FF00, 16, 16))
        _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x0000FF, 16, 16))
        _GUICtrlListView_SetImageList($idListview, $hImage, 0)

        ; Add columns
        _GUICtrlListView_AddColumn($idListview, "Items", 100)

        ; Add items
        _GUICtrlListView_AddItem($idListview, "Item 0", 0)
        _GUICtrlListView_AddItem($idListview, "Item 1", 1)
        _GUICtrlListView_AddItem($idListview, "Item 2", 2)

        ; Set outline color
        _GUICtrlListView_SetOutlineColor($idListview, 0x0000FF)
        MsgBox($MB_SYSTEMMODAL, "Information", "Outline Color: " & Hex(_GUICtrlListView_GetOutlineColor($idListview)))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
EndFunc   ;==>Example