huangwei 发表于 2013-1-13 10:47:59

请问,在脚本里怎么加个下拉框

本帖最后由 huangwei 于 2013-2-17 17:15 编辑

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

haijie1223 发表于 2013-1-13 15:44:53

GUICtrlCreateCombo

huangwei 发表于 2013-1-13 17:09:13

不是下拉框,而是上下拖动的那个列表框

xlcwxl 发表于 2013-1-13 17:22:45

$Combo1 = GUICtrlCreateCombo("Combo1", 96, 104, 313, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))

xlcwxl 发表于 2013-1-13 17:23:01

$Combo1 = GUICtrlCreateCombo("Combo1", 96, 104, 313, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))

huangwei 发表于 2013-1-13 17:55:03

你给的代码做出来的效果是这样
而是我要的效果是这样的
这代码不对把?

CCM 发表于 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加到超过,就出来了。

huangwei 发表于 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)
页: [1]
查看完整版本: 请问,在脚本里怎么加个下拉框