soonyee91 Posted May 27, 2013 Share Posted May 27, 2013 I have a problem using this two functions "FileSelectFolder" and "_FileListToArray". Whenever I click cancel button on the "FileSelectFolder". It will store value to my variable. Is there anyway to stop the variable from taking values? ; Loop until user exits While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $btn_browse $ordner = FileSelectFolder("Choose folder","") $dateien = _FileListToArray($ordner, "*", 1) _GUICtrlListBox_BeginUpdate($hListBox) For $i = 1 To UBound($dateien) - 1 ; Add file _GUICtrlListBox_AddString($hListBox, $dateien[$i]) Next _GUICtrlListBox_EndUpdate($hListBox) Case $msg = $btn_transfer ScanFolder($ordner) EndSelect WEnd Link to comment Share on other sites More sharing options...
Solution Zedna Posted May 27, 2013 Solution Share Posted May 27, 2013 (edited) ; Loop until user exits While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $btn_browse $tmp = FileSelectFolder("Choose folder", "") If Not @error Then $ordner = $tmp $dateien = _FileListToArray($ordner, "*", 1) _GUICtrlListBox_BeginUpdate($hListBox) For $i = 1 To UBound($dateien) - 1 ; Add file _GUICtrlListBox_AddString($hListBox, $dateien[$i]) Next _GUICtrlListBox_EndUpdate($hListBox) EndIf Case $msg = $btn_transfer ScanFolder($ordner) EndSelect WEnd Edited May 27, 2013 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
soonyee91 Posted May 27, 2013 Author Share Posted May 27, 2013 Thanks! I think this is what I'm looking for. My code structure is: -Obtain files from "filefolderselect" -Then update the listbox with "_GUICtrlListBox_AddString" The problem is everytime I click on that browse button the listbox is not refresh(Continue to add string into the listbox)? how should I structure my code then Link to comment Share on other sites More sharing options...
Zedna Posted May 27, 2013 Share Posted May 27, 2013 Disable button $btn_transfer when Cancel is pressed in FileSelectFolder() Resources UDF ResourcesEx UDF AutoIt Forum Search 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