本帖最后由 user3000 于 2013-10-20 23:30 编辑
回复 1# ioripalm
没看清,最终要获取的是控件句柄。重新编辑一下。
看示例吧。Local $iRadio = 1, $aRadio[10], $id
Local $hGui, $nMsg
$hGui = GUICreate('test', 400, 80)
For $i = 0 To 9
$aRadio[$i] = GUICtrlCreateRadio('R'&$i+1, $i*35+5, 20, 35)
Next
GUICtrlSetState($aRadio[0], 1);$GUI_CHECKED
$id = $aRadio[0]
$bt = GUICtrlCreateButton('查看', 200, 50)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
GUIDelete($hGui)
ExitLoop
Case $aRadio[0] To $aRadio[9]
$iRadio = $nMsg - $aRadio[0] +1
$id = $nMsg ; $iRadio + 2
Case $bt
MsgBox(0, '选中第' & $iRadio & '个单选', '该单选句柄: ' & GUICtrlGetHandle($id))
EndSwitch
WEnd
|