#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <File.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 180, 222, 192, 124)
$Button1 = GUICtrlCreateButton("读取C盘", 8, 8, 75, 25)
$Button2 = GUICtrlCreateButton("读取D盘", 96, 8, 75, 25)
$Combo1 = GUICtrlCreateCombo("", 8, 48, 161, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetData($Combo1,"");清空上一次
$aFileList = _FileListToArray("c:\");读取列表
For $i = 1 To $aFileList[0]
GUICtrlSetData($Combo1,$aFileList[$i]);把列表写入到combobox
Next
Case $Button2
GUICtrlSetData($Combo1,"")
$aFileList = _FileListToArray("d:\")
For $i = 1 To $aFileList[0]
GUICtrlSetData($Combo1,$aFileList[$i])
Next
EndSwitch
WEnd
|