菜鸟求问Radio控件问题
本帖最后由 pengjun521 于 2009-8-13 19:48 编辑创建了一个Group控件,里面添加了几个Radio控件,请问怎么获取到哪个Radio被按下
谢谢答复
#include <GUIConstantsEx.au3>
GUICreate("选框测试", 300, 200)
Dim $Checkbox, $cb, $radio, $rd
$Checkbox = GUICtrlCreateCheckbox("复选框1", 20, 20, 120, 20)
$Checkbox = GUICtrlCreateCheckbox("复选框2", 20, 50)
$Checkbox = GUICtrlCreateCheckbox("复选框3", 20, 80)
$radio = GUICtrlCreateRadio("单选框1", 150, 20)
$radio = GUICtrlCreateRadio("单选框2", 150, 50)
$radio = GUICtrlCreateRadio("单选框3", 150, 80)
$Button = GUICtrlCreateButton('查看选择', 70, 130, 150, 25)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
For $i = 1 To 3
If BitAND(GUICtrlRead($Checkbox[$i]), $GUI_CHECKED) Then
$cb[$i] = '复选框 ' & $i & ' 已选中'
Else
$cb[$i] = '复选框 ' & $i & ' 未选中'
EndIf
Next
For $i = 1 To 3
If BitAND(GUICtrlRead($radio[$i]), $GUI_CHECKED) Then $rd = '单选框 ' & $i & ' 已选中'
Next
MsgBox(0, '状态:', $cb & @CRLF & $cb & @CRLF & $cb & @CRLF & $rd)
EndSwitch
WEnd
楼上的太感谢你的指导了 祝福你
页:
[1]