日期:2009-05-14 浏览次数:20439 次
Private Sub RadioButton1_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles RadioButton1.CheckedChanged, _
RadioButton2.CheckedChanged, _
RadioButton3.CheckedChanged, _
RadioButton4.CheckedChanged, _
RadioButton5.CheckedChanged
End Sub
Public Sub New()
MyBase.New()
'This call is required by the
Windows Form Designer.
InitializeComponent()
'Add any initialization after
the InitializeComponent() call
radioButtons(0) = RadioButton1
radioButtons(1) = RadioButton2
radioButtons(2) = RadioButton3
radioButtons(3) = RadioButton4
radioButtons(4) = RadioButton5
End Sub
Private Sub RadioButton1_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles RadioButton1.CheckedChanged, _
RadioButton2.CheckedChanged, _
RadioButton3.CheckedChanged, _
RadioButton4.CheckedChanged, _
RadioButton5.CheckedChanged
Dim i As Integer = 0
Dim found As Boolean = False
While i < radioButtons.GetLength(0)
And Not found
If radioButtons(i).Checked Then
found = True
selectedOption = i + 1
Label1.Text = CStr(selectedOption)
End If
i += 1
End While
End Sub