litlmike Posted April 21, 2006 Share Posted April 21, 2006 I would like a GUI with a list with options A, B, C, D, E, F. I would like the user to be able to select 1 or all of the options. Then, when they click done, to take the user input. Is it possible highlight more than one option when using GUICtrlCreateList? Thanks in Advance. _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
falconv Posted April 21, 2006 Share Posted April 21, 2006 I know there's a way to select multiple options in a GUICtrlCreateList, but I haven't found a way to get the script to read all of the selected controls. To allow multiple selections, I think it's just a setting you add, check the help file for it, something like $LS_MULTIPLESEL or something... Link to comment Share on other sites More sharing options...
litlmike Posted April 24, 2006 Author Share Posted April 24, 2006 I know there's a way to select multiple options in a GUICtrlCreateList, but I haven't found a way to get the script to read all of the selected controls. To allow multiple selections, I think it's just a setting you add, check the help file for it, something like $LS_MULTIPLESEL or something...Thanks for the input. I wasn't able to find the Mulitple Selection setting. Does anyone know the exact setting? _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 24, 2006 Moderators Share Posted April 24, 2006 Thanks for the input. I wasn't able to find the Mulitple Selection setting. Does anyone know the exact setting?Could you use GUICtrlCreateListView() instead? If so then use something like this for the style. BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS) Link to comment Share on other sites More sharing options...
GaryFrost Posted April 24, 2006 Share Posted April 24, 2006 $listbox = GUICtrlCreateList("", 125, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL)) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 24, 2006 Moderators Share Posted April 24, 2006 $listbox = GUICtrlCreateList("", 125, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))I guess $LBS_MULTIPLESEL got left out when the help file was made? Link to comment Share on other sites More sharing options...
litlmike Posted April 24, 2006 Author Share Posted April 24, 2006 $listbox = GUICtrlCreateList("", 125, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL)) Yea, I guess that did get left out of the Help File. Who do we notify about that? Second, I tried the code given but got the following error: Do I need to #include something besides <GUIConstants.au3>? WARNING: $LBS_MULTIPLESEL: possibly used before declaration. ERROR: $LBS_MULTIPLESEL: undeclared global variable. _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
GaryFrost Posted April 24, 2006 Share Posted April 24, 2006 Yea, I guess that did get left out of the Help File. Who do we notify about that? Second, I tried the code given but got the following error: Do I need to #include something besides <GUIConstants.au3>? No one, it's a part of the beta UDFs Global Const $LBS_MULTIPLESEL = 0x8 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
litlmike Posted April 24, 2006 Author Share Posted April 24, 2006 No one, it's a part of the beta UDFs Global Const $LBS_MULTIPLESEL = 0x8Hey, thanks for the info. I got a feeling you know more about programming than any 1 person should be allowed to. You have very easily answered some of my questions in the past that have haunted me, and puzzled others. Thanks a lot. _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
litlmike Posted April 24, 2006 Author Share Posted April 24, 2006 Can anyone tell me why this does not work? When I set the list items as a variable, they do not work. $Alphabet = "a|b|c|d|e|f|g|h|i" $listbox = GUICtrlCreateList($Alphabet, 125, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL)) _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
litlmike Posted April 24, 2006 Author Share Posted April 24, 2006 Can anyone tell me why this does not work? When I set the list items as a variable, they do not work. $Alphabet = "a|b|c|d|e|f|g|h|i" $listbox = GUICtrlCreateList($Alphabet, 125, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))Nevermind, I needed to use, GuiCtrlSetData. I got to work. _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 25, 2006 Moderators Share Posted April 25, 2006 No one, it's a part of the beta UDFs Global Const $LBS_MULTIPLESEL = 0x8Then should it not be in the beta help file? Link to comment Share on other sites More sharing options...
GaryFrost Posted April 25, 2006 Share Posted April 25, 2006 Then should it not be in the beta help file? Example from the beta help file #include <GUIConstants.au3> #include <GuiList.au3> Opt ('MustDeclareVars', 1) Dim $msg, $ret, $listbox, $button, $i GUICreate("ListBox Selected Items Indices 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 = _GUICtrlListGetSelItems ($listbox) If (Not IsArray($ret)) Then MsgBox(16, "Error", "Unknown error from _GUICtrlListGetSelItems") Else For $i = 1 To $ret[0] MsgBox(0, "Selected", $ret[$i]) Next EndIf EndSelect WEnd SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 25, 2006 Moderators Share Posted April 25, 2006 Not to be rude, but that is not where 90% of us would go looking for list styles. Maybe there should be a "GUI Control Styles Beta" in the Appendix? Link to comment Share on other sites More sharing options...
GaryFrost Posted April 25, 2006 Share Posted April 25, 2006 Not to be rude, but that is not where 90% of us would go looking for list styles. Maybe there should be a "GUI Control Styles Beta" in the Appendix?If the powers that be decide to add it to the GuiConstants.au3 then it will be listed, for now it's a part of GuiList.au3 (Author: Me)Gary SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 25, 2006 Moderators Share Posted April 25, 2006 If the powers that be decide to add it to the GuiConstants.au3 then it will be listed, for now it's a part of GuiList.au3 (Author: Me)GaryIt makes sense now, thanks for clearing things up. 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