xyold1 发表于 2010-11-30 16:17:12

Combo (列表框)的项目文本 显示数量的问题[已解决]

本帖最后由 xyold1 于 2010-12-1 02:07 编辑

刚发现Combo (列表框)多于30条项目文本会显示不了,在Koda里也试了,只能显示30条,不知这是不是AU3的限制,有没有解决的办法?

cxm23 发表于 2010-11-30 17:06:01

#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 491, 203, 266, 199)
$Combo1 = GUICtrlCreateCombo("Combo1", 64, 72, 289, 25, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
For $i = 1 To 100
        GUICtrlSetData($Combo1,$i)
Next
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

meteor0330 发表于 2010-12-4 15:51:44

主要是上面的这个$WS_VSCROLL起作用!
我一开始也是遇到楼主同样的问题,后来搜索帮助找到的!呵呵!

pingfan5888 发表于 2011-2-20 17:54:19

不错的代码。。

gto250 发表于 2011-3-4 20:52:59

虽然是已经解决的问题,我还要回复一下,因为在我的电脑上,就算不加上后面的vscroll也能全部显示#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 491, 203, 266, 199)
$Combo1 = GUICtrlCreateCombo("Combo1", 64, 72, 289, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
For $i = 1 To 100
      GUICtrlSetData($Combo1,$i)
Next
While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

      EndSwitch
WEnd

hollandmfq 发表于 2014-6-10 13:37:50

谢谢分享,正用的上!如果能显示5个,然后在下拉就更好了!
页: [1]
查看完整版本: Combo (列表框)的项目文本 显示数量的问题[已解决]