找回密码
 加入
搜索
查看: 1838|回复: 1

[GUI管理] 这段代码 哪里错了 组合框 取值

[复制链接]
发表于 2013-12-26 15:09:11 | 显示全部楼层 |阅读模式
本帖最后由 PPTBS 于 2013-12-26 15:15 编辑
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\桌面\Form1.kxf
$Form1 = GUICreate("Form1", 566, 260, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 120, 64, 305, 25 )
GUICtrlSetData(-1, "请选择...|奇瑞|江淮", "请选择...")
$Combo2 = GUICtrlCreateCombo("", 120, 112, 305, 25)
GUICtrlSetData(-1, "请选择...|奇瑞|江淮", "请选择...")
$Button1 = GUICtrlCreateButton("Button1", 176, 160, 201, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE   ;关闭窗体事件
                        Exit
        Case $Button1         ;单元格单击事件
                    If BitAND(GUICtrlRead($Combo1), $GUI_CHECKED) Then
                                MsgBox(4096, $GUI_CHECKED, "这个消息框将会显示10秒", 10)


                        EndIf                            
                
                
        EndSwitch
WEnd
发表于 2013-12-27 11:25:41 | 显示全部楼层
帮助上貌似没说BitAND(GUICtrlRead($Combo1), $GUI_CHECKED) 适用于 combo

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <WinAPI.au3>;;;;;;;;;;;;;;;;;;;
#Include <GuiComboBox.au3>;;;;;;;;;;;;;;;;
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 566, 260, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 120, 64, 305, 25 )
GUICtrlSetData(-1, "请选择...|奇瑞|江淮", "请选择...")
$Combo2 = GUICtrlCreateCombo("", 120, 112, 305, 25)
GUICtrlSetData(-1, "请选择...|奇瑞|江淮", "请选择...")
$Button1 = GUICtrlCreateButton("Button1", 176, 160, 201, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE   ;关闭窗体事件
                        Exit
        Case $Button1         ;单元格单击事件                           
                        If _GUICtrlComboBox_GetCurSel(_WinAPI_GetDlgItem($Form1, $Combo1))>0 Then
                                MsgBox(4096, "", "这个消息框将会显示10秒", 10)
                        EndIf
        EndSwitch
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-3 03:29 , Processed in 0.073236 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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