在窗口中多个复选框控件,分成两组,如何设置两组内的复选框不能同时选择?
Dim a1 As WinForm.CheckBox = e.Form.Controls("CheckBox1")
Dim a2 As WinForm.CheckBox = e.Form.Controls("CheckBox2")
Dim a3 As WinForm.CheckBox = e.Form.Controls("CheckBox3")
Dim a4 As WinForm.CheckBox = e.Form.Controls("CheckBox4")
Dim a5 As WinForm.CheckBox = e.Form.Controls("CheckBox5")
Dim a6 As WinForm.CheckBox = e.Form.Controls("CheckBox6")
Dim a7 As WinForm.CheckBox = e.Form.Controls("CheckBox7")
Dim a8 As WinForm.CheckBox = e.Form.Controls("CheckBox8")
If a1.Checked = True Or a2.Checked = True Or a3.Checked = True Or a4.Checked = True Then
a5.Checked = False
a6.Checked = False
a7.Checked = False
a8.Checked = False
End If
If a5.Checked = True Or a6.Checked = True Or a7.Checked = True Or a8.Checked = True Then
a1.Checked = False
a2.Checked = False
a3.Checked = False
a4.Checked = False
End If
这样设置后5,6,7,8不能选择了,老师帮我看看阿有其他办法?谢谢老师