$form1 = GUICreate("Form",500,400);;;
Local $Radio[5], $L = 0
$Radio[0] = GUICtrlCreateRadio("", 25, 80, 15,15);;;
$lable1 = GUICtrlCreateLabel("1", 42, 80, 220);;;
GUICtrlSetColor(-1, 0x8B0000)
$Radio[1] = GUICtrlCreateRadio("", 25, 80+35, 15,15);;;
$lable2 = GUICtrlCreateLabel("2", 42, 80+35, 220);;;
GUICtrlSetColor(-1, 0x8B0000)
$Radio[2] = GUICtrlCreateRadio("", 25, 80+35*2, 15, 15);;;
$lable3 = GUICtrlCreateLabel("3", 42, 80+35*2, 220, 20);;;
GUICtrlSetColor(-1, 0x8B0000)
$Button3 = GUICtrlCreateButton("START", 170, 340, 150, 40);;
GuiCtrlSetState($Radio[$L], 1)
GUISetState()
$msg = "$form1 的控件id: " & $form1 & @CRLF
$msg &= "$Radio[0] 的控件id: " & $Radio[0] & @CRLF
$msg &= "$lable1 的控件id: " & $lable1 & @CRLF
$msg &= "$Radio[1] 的控件id: " & $Radio[1] & @CRLF
$msg &= "$lable2 的控件id: " & $lable2 & @CRLF
$msg &= "$Radio[2] 的控件id: " & $Radio[2] & @CRLF
$msg &= "$label2 的控件id: " & $lable3 & @CRLF
$msg &= "$Button3 的控件id: " & $Button3 & @CRLF
MsgBox(0, "debug info", $msg);;;;把这些控件id输出来看看你就明白怎么回事了
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Radio[0] To $Radio[2]
$L = $nMsg - 3;;;
Case $Button3
_Go1($L)
EndSwitch
WEnd
Func _Go1($iX)
Switch $iX
Case 0
MsgBox(0,"","1")
Case 1
MsgBox(0,"","2")
Case 2
MsgBox(0,"","3")
Case 3
MsgBox(0,"","4")
Case 4
MsgBox(0,"","5")
EndSwitch
EndFunc
|