TheAutomator 16 Posted June 6, 2022 Share Posted June 6, 2022 (edited) Can anyone tell me why this isn't working? The result should be a few selected items in the listbox.. #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $List1 = GUICtrlCreateList('', 315, 5, 45, 95, BitOR($LBS_MULTIPLESEL,$WS_VSCROLL), 0) GUICtrlSetData(-1, "a|b|c|d|e|f|g|h|i|j|k|l") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ControlCommand($Form1, '', $List1, 'SetCurrentSelection', 1) ControlCommand($Form1, '', $List1, 'SetCurrentSelection', 3) ;also failed attempt to make it work: _GUICtrlListBox_SelectString($List1, 'b') While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited June 6, 2022 by TheAutomator Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to post Share on other sites
Solution Subz 826 Posted June 6, 2022 Solution Share Posted June 6, 2022 Use: _GUICtrlListBox_SetSel($List1, 1, True) Link to post Share on other sites
TheAutomator 16 Posted June 6, 2022 Author Share Posted June 6, 2022 4 minutes ago, Subz said: Use: _GUICtrlListBox_SetSel($List1, 1, True) Aha! thanks! Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone Link to post Share on other sites
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