enigmaforceiv Posted September 1, 2012 Share Posted September 1, 2012 (edited) I'm going on day 2 trying to figure this out, deciding to ask for some help. I'm trying to list files (that are clickable) within a directory in the GUI tab object, but haven't been successful.I am able to get the list of files, which show up before the GUI is launched. I am currently using Array.au3 and File.au3 to do this. What I want is the files to appear within the tab windows of the tabbed items... if that makes sense. Any advice? Here is my code:#include <GUIConstantsEx.au3>#include <Array.au3>#include <File.au3>#include "RecFileListToArray.au3"_Main()Func _Main()Local $Buyers = _ArrayDisplay("C:DropboxCentury21Client DatabaseBuyers"); Variable is assigned to list the files and foldersGUICreate("C21 Chicago's Finest", 800, 600) ; creates windowGUICtrlCreateTab(50, 50, 700, 300)GUICtrlCreateTabItem("Buyers")GUICtrlCreateList((_FileListToArray($Buyers)), 50, 70, 699, 313)EndFuncGUISetState ()While 1Switch GUIGetMsg()Case $GUI_EVENT_CLOSEExitEndSwitchWEnd Edited September 1, 2012 by enigmaforceiv Link to comment Share on other sites More sharing options...
Fraser Posted September 1, 2012 Share Posted September 1, 2012 (edited) Hi, Try this: expandcollapse popup#region #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Tidy_Stop_OnError=n #endregion #include <File.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $font = "Arial" Global $GUI_BGC = "0xf0ffff" $GUI = GUICreate("List folder content", 500, 200, -1, -1) GUISetBkColor($GUI_BGC) $list = GUICtrlCreateList("", 2, 2, 496, 150) GUISetState(@SW_SHOW) Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(5000) $FileList = _FileListToArray("C:", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index ;_ArrayDisplay($FileList) For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Exit EndSelect WEnd link to help for _FileListToArray: http://www.autoitscript.com/autoit3/docs/libfunctions/_FileListToArray.htm Hope it helps, Fraser Edited September 1, 2012 by Fraser Link to comment Share on other sites More sharing options...
enigmaforceiv Posted September 1, 2012 Author Share Posted September 1, 2012 (edited) Perfect! The only problem is that the Array gives me another window (Like a spreadsheet) - after closing it, the files appear in the window. Removed _ArrayDisplay and now works perfectly! Thanks again. Edited September 1, 2012 by enigmaforceiv Link to comment Share on other sites More sharing options...
Fraser Posted September 1, 2012 Share Posted September 1, 2012 (edited) Edit: Not a problem, Glad to help! Sorry about that, i had _arraydisplay added. Find that and remove it shouldn't pop up again! expandcollapse popup#region #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Tidy_Stop_OnError=n #endregion #include #include #include #include #include Global $font = "Arial" Global $GUI_BGC = "0xf0ffff" $GUI = GUICreate("List folder content", 500, 200, -1, -1) GUISetBkColor($GUI_BGC) $list = GUICtrlCreateList("", 2, 2, 496, 150) GUISetState(@SW_SHOW) Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(5000) $FileList = _FileListToArray("C:", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index ;_ArrayDisplay($FileList) <<< For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Regards Fraser Edited September 1, 2012 by Fraser 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