这是两个控件 Combo 和 Button
点击button调用一下FileSelectFolder 函数弹出选择文件夹的 框
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 449, 192, 114)
$Combo1 = GUICtrlCreateCombo("", 72, 80, 177, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton("浏览...", 280, 72, 65, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$userpath = FileSelectFolder("选择一个位置", "")
If $userpath <> "" Then
GUICtrlSetData($Combo1, "")
GUICtrlSetData($Combo1, $userpath, $userpath)
EndIf
EndSwitch
WEnd
|