vb中option和check控件怎么让她的选中选项出现在msgbox弹出的窗口中,

比如有两个option选项一个是男一个是女,你选男,点击command,弹出窗口显示“您的性别是男”

第1个回答  2011-11-07
private sub command_click()
if check1.value=1 then 'Check控件选中打勾为男,不选中为女
msgbox "您的性别是男"
else
msgbox "您的性别是女"
end if
end sub追问

怎么弄这个啊

追答

private sub command_click()
if check1.value=1 then 'Check控件选中打勾为男,不选中为女
msgbox "您的性别是男" & " " & chr(13) &_
"您的学号是" & " " & Text1 &_ '用几个TextBox里面存学号,姓名等
.......
"您的班级:" & " " & TextN, vbokonly, “信息确认"
else
msgbox "您的性别是女" ‘与上面一样做
end if
end sub

本回答被提问者采纳
第2个回答  2011-11-07
添加两个Option,其中 Option1为男,Option2为女,在Command的Click过程中添加如下代码:
If Option1.Value = True Then
MsgBox "您的性别是男"
Else
MsgBox "您的性别是女"
End If追问

这样的怎么弄

第3个回答  2011-11-07
最简代码
Private Sub Command1_Click() 'Option1为男
MsgBox IIf(Option1.Value, "您的性别是男", "您的性别是女")
End Sub