本帖最后由 .Simba 于 2020-5-30 14:10 编辑
经过测试下拉菜单只能显示30个,如果过多,选择后边的会自动隐藏前边的菜单项,有办法修改吗?
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $Combo1
#Region ### START Koda GUI section ###
$Form1 = GUICreate("Form1", 593, 214, 448, 201)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Combo1 = GUICtrlCreateCombo("", 96, 84, 425, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetOnEvent(-1, "Combo1Change")
$Button1 = GUICtrlCreateButton("设置数据", 440, 132, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
GUICtrlSetData($Combo1, '')
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Combo1Change()
MsgBox(0, '', GUICtrlRead($Combo1))
EndFunc ;==>Combo1Change
Func Button1Click()
Local $n = ''
For $i = 1 To 50
$n &= $i & '|'
Next
GUICtrlSetData($Combo1, $n, '1')
EndFunc ;==>Button1Click
Func Form1Close()
Exit
EndFunc ;==>Form1Close
|