|
本帖最后由 yokoliu 于 2009-9-17 09:17 编辑
#include <GuiComboBoxEx.au3>
#include <GuiConstantsEx.au3>
$Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work
Local $hGUI, $hImage, $input, $hCombo,$sText
; Create GUI
$hGUI = GUICreate("ComboBoxEx Add Dir", 400, 300, -1, -1, -1)
$hCombo = _GUICtrlComboBoxEx_Create ($hGUI, "", 2, 2, 394, 100)
$binput = GUICtrlCreateButton("Input control", 2, 30, 120)
GUISetState()
_GUICtrlComboBoxEx_BeginUpdate ($hCombo)
_GUICtrlComboBoxEx_AddDir ($hCombo, @ScriptDir & "\*.mdb")
_GUICtrlComboBoxEx_EndUpdate ($hCombo)
GUICtrlSetState($hCombo,$GUI_DISABLE)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $binput
MsgBox(0,0,_GUICtrlComboBoxEx_GetCurSel($hCombo))
_GUICtrlComboBoxEx_GetItemText($hCombo,_GUICtrlComboBoxEx_GetCurSel($hCombo),$sText)
MsgBox(4160, "Information", "Edit Text: " & $sText)
EndSwitch
WEnd
上面的GUICtrlSetState($hCombo,$GUI_DISABLE)不起作用
如果用GUICtrlCreateCombo,就可以,但是 _GUICtrlComboBoxEx_AddDir ($hCombo, @ScriptDir & "\*.mdb")这句就不行了,_GUICtrlComboBoxEx_AddDir (GUICtrlGetHandle($hCombo), @ScriptDir & "\数据库\*.mdb"),也不行,
高手请支招 |
|