找回密码
 加入
搜索
查看: 1724|回复: 3

GUICtrlCreateRadio的选择

[复制链接]
发表于 2009-7-7 11:57:59 | 显示全部楼层 |阅读模式
论坛里面这么搜索不到相关的信息
$Radio1        = GUICtrlCreateRadio("abc", 10, 10, 80, 20)
$Radio2        = GUICtrlCreateRadio("cba", 100, 10, 80, 20)
选择$Radio1执行一个动作
选择$Radio2的时候执行另一个动作
用 If 能做到么
 楼主| 发表于 2009-7-7 15:28:35 | 显示全部楼层
终于琢磨出来了
发表于 2009-7-7 15:30:57 | 显示全部楼层
#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

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()      ; 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 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
                MsgBox(64, 'Info:', 'You clicked the Radio 1 and it is Checked.')
            Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
                MsgBox(64, 'Info:', 'You clicked on Radio 2 and it is Checked.')
        EndSelect
    WEnd
EndFunc   ;==>Example
帮助文件里的例子
有时候真的别怪人...
发表于 2010-4-25 15:42:29 | 显示全部楼层
能不能就指定一个有效,而不用点击????
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 07:31 , Processed in 0.090227 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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