写了个简单又完整点的#Include <GuiButton.au3>
GUICreate('分组单选框例子 by afan')
Local $Radio[6], $L = 1, $R = 5
$Radio[0] = GUICtrlCreateRadio('dgsdgfgsdg', 30, 30 * 1 - 15)
$Radio[1] = GUICtrlCreateRadio('gjgsfsfg', 30, 30 * 2 - 15)
$Radio[2] = GUICtrlCreateRadio('lkhjlhjljhlffgfw', 30, 30 * 3 - 15)
GUIStartGroup()
$Radio[3] = GUICtrlCreateRadio('gfjt86rgn', 200, 30 * 1 - 15)
$Radio[4] = GUICtrlCreateRadio('ulku6856784h', 200, 30 * 2 - 15)
$Radio[5] = GUICtrlCreateRadio('nghjgk', 200, 30 * 3 - 15)
GuiCtrlSetState($Radio[$L], 1)
GuiCtrlSetState($Radio[$R], 1)
$Button = GUICtrlCreateButton('读取或执行', 100, 300, 150, 20)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Radio[0] To $Radio[2]
$L = $nMsg - 3
Case $Radio[3] To $Radio[5]
$R = $nMsg - 3
Case $Button
MsgBox(0, '选中了', _GUICtrlButton_GetText($Radio[$L]) & @LF & _
_GUICtrlButton_GetText($Radio[$R]))
_Go($L)
_Go($R)
EndSwitch
WEnd
Func _Go($iX)
Switch $iX
Case 0
MsgBox(0, '', '执行左1任务')
Case 1
MsgBox(0, '', '执行左2任务')
Case 2
MsgBox(0, '', '执行左3任务')
Case 3
MsgBox(0, '', '执行右1任务')
Case 4
MsgBox(0, '', '执行右2任务')
Case 5
MsgBox(0, '', '执行右3任务')
EndSwitch
EndFunc
|