faustf Posted September 19, 2016 Share Posted September 19, 2016 hi guys expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> Example() Func Example() Local $hImage, $idListview ; Create GUI GUICreate("ListView Add SubItem", 400, 300) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)) GUISetState(@SW_SHOW) ; Load images $hImage = _GUIImageList_Create() _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($idListview), 0xFF0000, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($idListview), 0x00FF00, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($idListview), 0x0000FF, 16, 16)) _GUICtrlListView_SetImageList($idListview, $hImage, 1) ; Add columns _GUICtrlListView_InsertColumn($idListview, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($idListview, 1, "Column 2", 100) _GUICtrlListView_InsertColumn($idListview, 2, "Column 3", 100) ; Add items _GUICtrlListView_AddItem($idListview, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 2", 1, 1) _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 3", 1, 2) ;_GUICtrlListView_AddItem($idListview, "Row 2: Col 1", 1) ;_GUICtrlListView_AddSubItem($idListview, 0, "Row 2: Col 2", 1, 2) ;_GUICtrlListView_AddItem($idListview, "Row 3: Col 1", 2) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example why if i run this script i see only row 1: col1 and row 1 col 3 ??? i think in this mode i should see row 1 col1 row 1 col 2 and row 1 col 3 under the row1 col2 Link to comment Share on other sites More sharing options...
VeryGary Posted September 20, 2016 Share Posted September 20, 2016 (edited) I think you want... _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 3", 2, 2) Quote #include <GuiListView.au3> _GUICtrlListView_AddSubItem ( $hWnd, $iIndex, $sText, $iSubItem [, $iImage = -1] ) Parameters $hWnd Control ID/Handle to the control $iIndex 0-based index of the item $sText Item or subitem text $iSubItem 1-based index of the subitem $iImage [optional] 0-based index of the icon in the control's image list If you want "Row 1: Col 3" to appear in Row 2, Col 2 you have to create an item for row 2 and add it as a subitem for that item. _GUICtrlListView_AddItem() creates the row and first item in the row. _GUICtrlListView_AddSubItem() creates additional subitems in the row. Items and subitems are oriented left to right, not top to bottom. Edited September 20, 2016 by VeryGary faustf 1 Link to comment Share on other sites More sharing options...
faustf Posted September 20, 2016 Author Share Posted September 20, 2016 thankz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now