【正确答案】单选按钮的标题由Caption属性设置,判断单选按钮的状态通过Value属性来实现。如果单选按钮被选中,则Value值为1;没选中,Value值为0。
根据题意,将3个单选按钮控件、一个命令按钮和一个标签添加到窗体中,单选按钮的名称分别为Option1、Option2和Option3,Caption属性分别为“汉语”、“英语”和“德语”,命令按钮的名称为Command1、Caption属性为“输出”,标签的名称为Label1,Caption属性为空。双击Command1进入代码编写窗口,利用If…else语句进行判断,补充后的具体代码如下:
Private Sub Command1_Click()
If Option1.
Value=True Then
Label1.
Caption="我的母语是"+Option1.
Caption Else
If Option2.
Value=True Then
Label1.
Caption="我的母语是"+Option2.
Caption Else
Label1.
Caption="我的母语是"+Option3.
Caption End If
End If
End Sub
单击
