找回密码
 加入
搜索
查看: 1611|回复: 5

[AU3基础] 如何实现可输值的下拉菜单?[已解决]

  [复制链接]
发表于 2012-9-25 20:35:18 | 显示全部楼层 |阅读模式
本帖最后由 tree945 于 2012-9-26 11:35 编辑

做一个可选下拉菜单,同时还可以输入任何值?谢谢,如下图形式

本帖子中包含更多资源

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

×
发表于 2012-9-25 21:00:17 | 显示全部楼层
GUICtrlCreateCombo函数试试...
发表于 2012-9-26 09:04:24 | 显示全部楼层
GUICtrlCreateCombo("",212, 3, 55, 21)不需要任何样式!如图可以输入值

本帖子中包含更多资源

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

×
发表于 2012-9-26 11:06:21 | 显示全部楼层
楼主的意思是把新输入的增加到下拉框吧?

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Dim $String = "|Combo1|1|2|3|4|5|6|7|8"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 442, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 152, 80, 201, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, $String, "Combo1")
$Button1 = GUICtrlCreateButton("开始计算", 392, 72, 97, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                        
                Case $Button1
                        If Not StringInStr($String, GUICtrlRead($Combo1)) Then
                                $String &= "|" & GUICtrlRead($Combo1)
                                GUICtrlSetData($Combo1, $String, GUICtrlRead($Combo1))
                        EndIf

        EndSwitch
WEnd
 楼主| 发表于 2012-9-26 11:33:17 | 显示全部楼层
谢谢大家,搞定了
发表于 2012-10-15 01:17:43 | 显示全部楼层
好东西值得收藏
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-29 21:27 , Processed in 0.084200 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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