VB中怎样确定多个单选按钮中是哪个被选中

来源:百度知道 编辑:UC知道 时间:2024/05/06 02:34:13
如果有2个单选按钮,一个确定按钮,选择不同的单选按钮的时

候点确定进不同的界面,在确定按钮里面要怎么写代码识别哪

个单选按钮被选中的。就是被选中的单选按钮和没被选中的单

选按钮的属性有什么不同。

添加一个OPTION控件,复制-粘贴,建立 控件组
比如复制6个代码如下:Private Sub Command1_Click() For i = 0 To 5 If Option1(i).Value = True Then MsgBox Option1(i).Caption & "被选中" NextEnd Sub

Private Sub Command1_Click()
If (Option1.Value = True) Then MsgBox ("Option1 is select!")
If (Option2.Value = True) Then MsgBox ("Option2 is select!")
End Sub

value值不同