YuChan 0 Posted Wednesday at 04:32 AM Hello, I want create on combo list with file in this directory I have this: Func _loadListeConfig() ; Liste tous les fichiers et sous-répertoires du dossier bureau en utilisant les paramètres par défaut. Local $aFileList = _FileListToArray(@ScriptDir, "trajet") If @error = 1 Then MsgBox($MB_SYSTEMMODAL, "", "Le chemin était incorrect.") Exit EndIf If @error = 4 Then MsgBox($MB_SYSTEMMODAL, "", "Aucun fichier trouvé.") Exit EndIf _ArrayDisplay($aFileList, "$aFileList") $myCombo = GUICtrlCreateCombo("Dialog", 280, 150, 200, 408) $txt = "" For $i = 1 to $aFileList[0] $txt &= $aFileList[$i] & "|" Next GUICtrlSetData($myCombo, $aFileList) EndFunc ;==>Example But my combo box is empty. Please can you help me ? Share this post Link to post Share on other sites
Musashi 305 Posted Wednesday at 07:36 AM (edited) 3 hours ago, YuChan said: But my combo box is empty. Quick example for illustration : expandcollapse popup#include <GUIConstantsEx.au3> #include <Constants.au3> #include <Array.au3> #include <File.au3> Local $iGuiMsg, $OkButton, $myCombo, $sCombo GUICreate("", 600, 300, -1, -1, 0x00010000) $sCombo = _LoadListeConfig() $myCombo = GUICtrlCreateCombo("", 20, 50, 560, 40) GUICtrlSetData($myCombo, $sCombo) $OkButton = GUICtrlCreateButton("Close", 200, 200, 200, 40) GUISetState() While 1 $iGuiMsg = GUIGetMsg() Select Case $iGuiMsg = $GUI_EVENT_CLOSE ExitLoop Case $iGuiMsg = $OkButton ExitLoop EndSelect WEnd GUIDelete() Func _LoadListeConfig() ; Lists all files and subdirectories in the desktop folder using the default settings. Local $sText = "" Local $aFileList = _FileListToArrayRec(@ScriptDir, "*", $FLTAR_FILESFOLDERS, $FLTAR_NORECUR , Default, $FLTAR_FULLPATH) If @error = 1 Then MsgBox($MB_SYSTEMMODAL, "", "The path was incorrect.") Exit EndIf If @error = 4 Then MsgBox($MB_SYSTEMMODAL, "", "No files found.") Exit EndIf _ArrayDisplay($aFileList, "$aFileList") For $i = 1 To $aFileList[0] $sText &= $aFileList[$i] & "|" Next Return($sText) EndFunc ;==>_LoadListeConfig Edited Wednesday at 07:39 AM by Musashi "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Share this post Link to post Share on other sites
YuChan 0 Posted Wednesday at 07:41 AM THX it's ok for me Share this post Link to post Share on other sites