找回密码
 加入
搜索
查看: 2835|回复: 10

[AU3基础] 怎么下拉框只能显示30个项

  [复制链接]
发表于 2015-10-18 19:36:46 | 显示全部楼层 |阅读模式
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("测试", 190, 97, 370, 225)
$Label1 = GUICtrlCreateLabel("测试", 8, 8, 136, 17)
$b=GUICtrlCreateCombo("", 8, 32, 81, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$CBS_SIMPLE))


$Button1 = GUICtrlCreateButton("确定", 112, 32, 57, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

for $a=1 to 80 step 1
        if $a<10 Then
                $a="0" & $a
        EndIf
        GUICtrlSetData($b,$a,"01")
        Next


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
发表于 2015-10-18 19:54:55 | 显示全部楼层
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("测试", 190, 97, 370, 225)
$Label1 = GUICtrlCreateLabel("测试", 8, 8, 136, 17)
$b=GUICtrlCreateCombo("", 8, 32, 81, 25, BitOR(0x0002,$CBS_AUTOHSCROLL,$CBS_SIMPLE))


$Button1 = GUICtrlCreateButton("确定", 112, 32, 57, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

for $a=1 to 80 step 1
        if $a<10 Then
                $a="0" & $a
        EndIf
        GUICtrlSetData($b,$a)
                Send('{down}')
        Next


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
 楼主| 发表于 2015-10-18 20:17:03 | 显示全部楼层
回复 2# Huiseyu


这没什么意义吧,只是显示后面30个项而已,就不能一次显示所有?或者跟随选择而自动滚动么??
发表于 2015-10-18 21:07:41 | 显示全部楼层
取消样式。。

评分

参与人数 1金钱 +10 收起 理由
xyold1 + 10

查看全部评分

 楼主| 发表于 2015-10-18 21:16:44 | 显示全部楼层
取消样式。。
Huiseyu 发表于 2015-10-18 21:07



    的确可以,请问假如不允许编辑呢??????应该加什么样式??
 楼主| 发表于 2015-10-18 21:20:36 | 显示全部楼层
的确可以,请问假如不允许编辑呢??????应该加什么样式??
friendtasy 发表于 2015-10-18 21:16



    也就是不显示编辑框,只能选择,不能更改
 楼主| 发表于 2015-10-18 21:24:39 | 显示全部楼层
似乎有样子都没办法显示所有,那么该如何让它自动滚动呢?
 楼主| 发表于 2015-10-18 21:24:46 | 显示全部楼层
似乎有样子都没办法显示所有,那么该如何让它自动滚动呢?
 楼主| 发表于 2015-10-18 22:25:43 | 显示全部楼层
BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE,$CBS_DISABLENOSCROLL,$WS_BORDER)

原来如此设置样式就达到要求了,感谢各位的帮助
发表于 2015-10-21 23:42:02 | 显示全部楼层
感谢各位的帮助
发表于 2015-10-22 21:32:34 | 显示全部楼层
不错, 我原来 一直是取消样式来使用的。 学了一招
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-28 22:18 , Processed in 0.090713 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表