是这个意思么#include <GUIConstantsEx.au3>
#include <GuiComboBox.au3>
$Form1 = GUICreate("xx", 535, 454, 193, 115)
GUISetBkColor(0xECE9D8)
$combo2 = GUICtrlCreateCombo("", 20, 42, 100, 20) ; 创建一个组合列表框(ComboBox)控件
GUICtrlSetData(-1, "", "") ; 在列表框中添加新的项目,并设置一个新的默认值
$btn1 = GUICtrlCreateButton("刷新", 188, 42, 47, 20)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
;DirRemove($Temp, 1)
Exit
Case $btn1
_searchfile("d:\myau3\*.au3")
EndSwitch
WEnd
Func _searchfile($path)
GUICtrlSetData($combo2,"")
Local $search = FileFindFirstFile($path)
If Not @error Then
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
_GUICtrlComboBox_AddString($combo2, $file)
WEnd
EndIf
EndFunc ;==>_searchfile
|