checkbox1和checkbox2 为必须其一,互相排斥
代码放在都click中
chk1:
Dim
chk1 As WinForm.CheckBox = e.Form.Controls("CheckBox1")
Dim
chk2 As WinForm.CheckBox = e.Form.Controls("CheckBox2")
If
chk1.checked=True
Then
chk1.checked
=True
chk2.checked
=False
chk1.ForeColor=Color.LimeGreen
chk2.ForeColor=Color.black
Else
chk2.checked
=True
chk1.checked
=False
chk2.ForeColor=Color.LimeGreen
chk1.ForeColor=Color.black
End
If
chk2:
Dim
chk1 As WinForm.CheckBox = e.Form.Controls("CheckBox1")
Dim
chk2 As WinForm.CheckBox = e.Form.Controls("CheckBox2")
If
chk2.checked=True Then
chk2.ForeColor=Color.LimeGreen
chk1.ForeColor=Color.black
chk2.checked
=True
chk1.checked
=False
Else
chk1.checked
=True
chk1.ForeColor=Color.LimeGreen
chk2.ForeColor=Color.black
chk2.checked
=False
End
If
开发时没有错误,发布后,点击几下竟然出现这种结果?
此主题相关图片如下:图片1.png