Jump to content
Sign in to follow this  

GUICtrlCreateListView style?

Recommended Posts

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>

Opt('MustDeclareVars', 1)

$Debug_LV = False; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work


Func _Main()
    Local $hImage, $hListView
    GUICreate("ListView End Update", 400, 300)

    $hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
    GUICtrlSetStyle($hListView, $LVS_ICON)
; Load images
    $hImage = _GUIImageList_Create(32, 32)
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($hListView), 0xFF0000, 32, 32))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($hListView), 0x00FF00, 32, 32))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($hListView), 0x0000FF, 32, 32))
    _GUICtrlListView_SetImageList($hListView, $hImage, 0)

; Add items
    For $iI = 1 To 10
        _GUICtrlListView_AddItem($hListView, "Red", 0)
        _GUICtrlListView_AddItem($hListView, "Green", 1)
        _GUICtrlListView_AddItem($hListView, "Blue", 2)

; Loop until user exits
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc  ;==>_Main

Color can change BMP files?And the style will not change!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...