找回密码
 加入
搜索
查看: 2192|回复: 7

[AU3基础] 请问,在脚本里怎么加个下拉框

  [复制链接]
发表于 2013-1-13 10:47:59 | 显示全部楼层 |阅读模式
本帖最后由 huangwei 于 2013-2-17 17:15 编辑

关键的是怎么在里面加按钮。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2013-1-13 15:44:53 | 显示全部楼层
GUICtrlCreateCombo
 楼主| 发表于 2013-1-13 17:09:13 | 显示全部楼层
不是下拉框,而是上下拖动的那个列表框
发表于 2013-1-13 17:22:45 | 显示全部楼层
$Combo1 = GUICtrlCreateCombo("Combo1", 96, 104, 313, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
发表于 2013-1-13 17:23:01 | 显示全部楼层
$Combo1 = GUICtrlCreateCombo("Combo1", 96, 104, 313, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
 楼主| 发表于 2013-1-13 17:55:03 | 显示全部楼层
你给的代码做出来的效果是这样
而是我要的效果是这样的
这代码不对把?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2013-1-14 09:40:44 | 显示全部楼层
刚刚玩了一下,貌似栏位数量超过设定高度时,上下拖条就会自己出现了,你试试看。

#include <GUIConstantsEx.au3>

Example()

Func Example()
        Local $MESSAGE = "The following buttons have been clicked"
        Local $add, $clear, $mylist, $close, $msg

        GUICreate("My GUI list") ; will create a dialog box that when displayed is centered

        $add = GUICtrlCreateButton("Add", 64, 32, 75, 25)
        $clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25)
        $mylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97)
        GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling
        GUICtrlSetData(-1, $MESSAGE)
        $close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25)

        GUISetState()

        $msg = 0
        While $msg <> $GUI_EVENT_CLOSE
                $msg = GUIGetMsg()

                Select
                        Case $msg = $add
                                GUICtrlSetData($mylist, "You clicked button No1|")
                        Case $msg = $clear
                                GUICtrlSetData($mylist, "")
                        Case $msg = $close
                                MsgBox(0, "", "the closing button has been clicked", 2)
                                Exit
                EndSelect
        WEnd
EndFunc   ;==>Example

上面是范例,你按ADD加到超过,就出来了。
 楼主| 发表于 2013-1-14 21:21:05 | 显示全部楼层
回复 7# CCM


    谢谢你,已经有点头绪了上下托条已经出来了但是我想要里面的每一行都是以按钮形式显示,这样就不会太难看
看你看看例子
下面是代码应该有些地方要改动,应该怎么改
$mylist = GUICtrlCreateList("左前摄像枪", -2, 98, 137, 266)
$add = GUICtrlCreateButton("右后摄像枪", 1, 133, 132, 31)
$add = GUICtrlCreateButton("全景摄像枪", 1, 163, 132, 33)
$add = GUICtrlCreateButton("打印摄像枪", 1, 195, 131, 33)
$add = GUICtrlCreateButton("作业量统计", 1, 227, 131, 33)
$add = GUICtrlCreateButton("已合格车辆", 1, 259, 131, 33)
$add = GUICtrlCreateButton("左前右后照", 1, 291, 131, 33)
$add = GUICtrlCreateButton("左前右后照", 1, 323, 131, 33)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-29 22:41 , Processed in 0.081219 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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