如何实现可输值的下拉菜单?[已解决]
本帖最后由 tree945 于 2012-9-26 11:35 编辑做一个可选下拉菜单,同时还可以输入任何值?谢谢,如下图形式 GUICtrlCreateCombo函数试试... GUICtrlCreateCombo("",212, 3, 55, 21)不需要任何样式!如图可以输入值 楼主的意思是把新输入的增加到下拉框吧?
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Dim $String = "|Combo1|1|2|3|4|5|6|7|8"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 442, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 152, 80, 201, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, $String, "Combo1")
$Button1 = GUICtrlCreateButton("开始计算", 392, 72, 97, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If Not StringInStr($String, GUICtrlRead($Combo1)) Then
$String &= "|" & GUICtrlRead($Combo1)
GUICtrlSetData($Combo1, $String, GUICtrlRead($Combo1))
EndIf
EndSwitch
WEnd
谢谢大家,搞定了 好东西值得收藏
页:
[1]