Sign in to follow this  
Followers 0
WTS

get text from multiselect for a listview

3 posts in this topic

#1 ·  Posted (edited)

How do I get all items that is selected in a listview..

$ret = _GUICtrlListViewGetCurSel($Listview) 
                For $i = 1 To $ret[0]
                    MsgBox(0, "Selected", $ret[$i])
                Next

http://www.autoitscript.com/forum/index.php?showtopic=27908

how do you do this with a listview??

$ret = _GUICtrlListGetSelItemsText ($listbox)
            If (Not IsArray($ret)) Then
                MsgBox(16, "Error", "Unknown error from _GUICtrlListGetSelItemsText")
            Else
                For $i = 1 To $ret[0]
                    MsgBox(0, "Selected", $ret[$i])
                Next
            EndIf

I tried.. but no go

$pos = GUIGetCursorInfo()
 If ($pos[4] == $listbox) Then
                $ret = _GUICtrlListViewGetCurSel($listbox)
                For $i = 1 To $ret[0]
                MsgBox(0, "Selected",_GUICtrlListViewGetItemText ($listbox,$ret[$i], 0))
                Next
  EndIf
Edited by WTS

Share this post


Link to post
Share on other sites



depends on what you want from the selected items, the following would give you the text of the 1st column of each selected item

Local $a_indices = _GUICtrlListViewGetSelectedIndices($listview,1)
            If(IsArray($a_indices))Then
                Local $i
                For $i = 1 To $a_indices[0]
                    MsgBox(0,"Selected", _GUICtrlListViewGetItemText ($listview, $a_indices[$i], 0))
                Next
            Else
                GUICtrlSetData($Status, "Not Items Selected")
            EndIf

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

thank you! you rock Gary.

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  
Followers 0