TravisC Posted March 22, 2008 Posted March 22, 2008 how can i recieve multipe selected entries from a listview? GUICtrlRead seems to only return the first selected one by default.
rasim Posted March 23, 2008 Posted March 23, 2008 (edited) Example: expandcollapse popup#include <GuiListView.au3> #include <GuiConstantsEx.au3> #include <Array.au3> ;Only for array show Global $aGetData $Gui = GUICreate("Test", 320, 220) $hListView = GUICtrlCreateListView("Items|SubItems", 10, 10, 300, 170, $LVS_REPORT, BitOR($LVS_EX_FULLROWSELECT , $WS_EX_CLIENTEDGE)) For $i = 1 To 6 GUICtrlCreateListViewItem("Item" & $i & "|" & "SubItem" & $i, $hListView) Next $GetCount_Btn = GUICtrlCreateButton("Get selected", 10, 190, 80, 20) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $GetCount_Btn $aGetData = _GetEntries(_GUICtrlListView_GetSelectedIndices($hListView, True)) _ArrayDisplay($aGetData) EndSwitch WEnd Func _GetEntries($aIndex) If $aIndex[0] < 1 Then Return False Local $aData[UBound($aIndex)][2] $aData[0][0] = $aIndex[0] For $i = 1 To $aIndex[0] $aData[$i][0] = _GUICtrlListView_GetItemText($hListView, $aIndex[$i]) $aData[$i][1] = _GUICtrlListView_GetItemText($hListView, $aIndex[$i], 1) Next Return $aData EndFunc Edited March 23, 2008 by rasim
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