Immensee Posted June 20, 2006 Posted June 20, 2006 Hey, i need an easy and quik help, I've created a program with a list (GUICtrlCreatelist), but if i click on multiple texts in the list, it will only select one text. is there a way to select more then one thing in a list? Thanks!!! -ImMenSe
BigDod Posted June 20, 2006 Posted June 20, 2006 Example straight from help file #include <GUIConstants.au3> #include <GuiList.au3> Opt ('MustDeclareVars', 1) Dim $msg, $ret Dim $listbox, $button, $label, $i GUICreate("ListBox Selected Items Text Demo", 400, 250, -1, -1) $listbox = GUICtrlCreateList("", 125, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL)) GUICtrlSetData($listbox, "test1|more testing|even more testing|demo|") $button = GUICtrlCreateButton("Get Selected", 150, 160, 120, 40) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button $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 EndSelect WEnd Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
Moderators SmOke_N Posted June 20, 2006 Moderators Posted June 20, 2006 $LBS_MULTIPLESEL: I don't see that in the Beta Help: GUI Control Styles.. am I missing it somewhere? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
GaryFrost Posted June 20, 2006 Posted June 20, 2006 GuiList.au3 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
WTS Posted June 20, 2006 Posted June 20, 2006 (edited) 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 June 20, 2006 by WTS
GaryFrost Posted June 20, 2006 Posted June 20, 2006 ListView and ListBox are 2 different things. $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 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Immensee Posted June 20, 2006 Author Posted June 20, 2006 What!? I can't find that thing in the help file But thanks for the help ! I'm now trying to transfer this code and code it in my program. -ImMenSe
WTS Posted June 20, 2006 Posted June 20, 2006 errr... Gary.. I know they're two different things thats why I'm asking how I can do the example submitted for a listview
GaryFrost Posted June 20, 2006 Posted June 20, 2006 User Defined Functions GuiList Management Gary SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
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