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

[GUI管理] 新手问问题 radio

[复制链接]
发表于 2015-6-22 17:41:25 | 显示全部楼层 |阅读模式
我有一张form, 里面有两个 radio1 和 radio2, 但我要怎 么表示选中 radio1 时要做A, 选中radio2 时要做B?

if 选中 radio1 then

A

endif

这个选中怎么表达?
发表于 2015-6-22 18:08:53 | 显示全部楼层
GUICtrlRead($radio1)
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
        Local $radio1, $radio2, $msg
        GUICreate("My GUI radio") ; will create a dialog box that when displayed is centered

        $radio1 = GUICtrlCreateRadio("Radio 1", 10, 10, 120, 20)
        $radio2 = GUICtrlCreateRadio("Radio 2", 10, 40, 120, 20)
        GUICtrlSetState($radio2, $GUI_CHECKED)

        GUISetState(@SW_SHOW) ; will display an  dialog box with 1 checkbox

        ; Run the GUI until the dialog is closed
        While 1
                $msg = GUIGetMsg()
                Select
                        Case $msg = $GUI_EVENT_CLOSE
                                ExitLoop
                        Case $msg = $radio1
                                If GUICtrlRead($radio1) = 1 Then
                                        MsgBox($MB_SYSTEMMODAL, 'Info:', 'You clicked the Radio 1 and it is Checked.')
                                EndIf
                        Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
                                MsgBox($MB_SYSTEMMODAL, 'Info:', 'You clicked on Radio 2 and it is Checked.')
                EndSelect
        WEnd
EndFunc   ;==>Example
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-4 09:58 , Processed in 0.090881 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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