Jump to content
Sign in to follow this  

problem adding _GUICtrlListView_AddSubItem

Recommended Posts


Surely the help file examples can't be that hard to comprehend ?

Maybe explain where your having a problem trying to understand it.

#include <GuiConstantsEx.au3>
#include <GuiListView.au3>

$hGUI = GUICreate("(Internal) ListView Add SubItem", 400, 300)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268)

; Create Columns to hold Item and Sub Item
; 1st Column 1 is for Item(s) 
_GUICtrlListView_InsertColumn ($hListView, 0, "Column 1")
; 2nd Column 2 Is for Sub Item(s)
_GUICtrlListView_InsertColumn ($hListView, 1, "Column 2")

; Create Item and Sub Item
; Add Item in Column 1
_GUICtrlListView_AddItem ($hListView, "Item 1 in Column 1", 0)
;Add a Sub Item in Column 2
_GUICtrlListView_AddSubItem ($hListView, 0, "Sub Item 1 in Col 2", 1)

; This was just to set the column width automatically to the width of the text in each column. 
_GUICtrlListView_SetColumnWidth($hListView, 0, $LVSCW_AUTOSIZE) 
_GUICtrlListView_SetColumnWidth($hListView, 1, $LVSCW_AUTOSIZE) 


While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
        Case Else
            ;;; Do whatever


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  

  • Create New...