Trinnon Posted October 22 Share Posted October 22 I have been messing with this listbox and trying to get the listed items to reset based on the option that is selected. Right now it add the list but when you click on the other option it adds the list again. I am looking for a way to reset the list if a new option is selected. I tried just resetting with $List1 = "" at the start of each Case but it doesnt function as I expected. I did not see anything in the help file for clearing or resetting the list unless I missed it. Does anyone know a way to make this work or an alternative option that would do the same thing to populate the list from a text file? expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #include <GUIListBox.au3> #include <Array.au3> #include <File.au3> #Region ### START Koda GUI section ### Form=\\bjcsccmfr01\osd.files\_ProdTSFiles\OSDFrontEnd-v2\OptionListFormTest.kxf $Form1 = GUICreate("OptionListForm", 383, 437, 324, 124) $List1 = GUICtrlCreateList("", 48, 120, 217, 266) $Option1rdo = GUICtrlCreateRadio("Option 1", 48, 24, 73, 25) $Option2rdo = GUICtrlCreateRadio("Option 2", 48, 56, 73, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GLOBAL $sOptionList = @ScriptDir & "\OptionList.txt" Global $aList Global $sList While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Option1rdo _FileReadToArray($sOptionList, $aList, $FRTA_NOCOUNT) $sList = _ArrayToString($aList, "|") GUICtrlSetData($List1, $sList, "") Case $Option2rdo _FileReadToArray($sOptionList, $aList, $FRTA_NOCOUNT) $sList = _ArrayToString($aList, "|") GUICtrlSetData($List1, $sList, "") Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Thanks, Trinnon Link to comment Share on other sites More sharing options...
Solution Nine Posted October 22 Solution Share Posted October 22 GUICtrlSetData($idMylist, "") As per example in help file of GUICtrlCreateList “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Trinnon Posted October 22 Author Share Posted October 22 Completely missed that one. Works perfectly. Thanks!!! 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