vb option button 的问题

2025-01-03 19:01:46
推荐回答(4个)
回答1:

Private Sub Command1_Click()
If Option1.Value Then
If MsgBox("A", vbYesNo) = vbYes Then
'你要继续做的事
End If
Else
If MsgBox("B", vbYesNo) = vbYes Then
'你要继续做的事
End If
End If
End Sub

回答2:

楼上错了,还要点command1呢
Private Sub Command1_Click()
If Option1.Value = True Then
a = MsgBox("a", vbYesNo)
If a = vbYes Then
'继续
End If
ElseIf Option2.Value = True Then
a = MsgBox("b", vbYesNo)
If a = vbYes Then
'继续
End If
End If
End Sub

回答3:

Option Explicit
Dim A
Private Sub Command1_Click()
If Option1.Value = True Then
A = MsgBox("A", vbYesNo)
If A = vbYes Then
Print "继续1"
Else
Print "结束1"
End If
Else

A = MsgBox("B", vbYesNo)
If A = vbYes Then
Print "继续2"
Else
Print "结束2"
End If
End If
End Sub
代码自己修改吧

回答4:

Practice sub option1_click()
Dim a
A=msgbox("a")
If a=6 then
<你要做的事>
end if
End sub
Private sub option2_click()
Dim a
A=msgbox("b")
If a=6 then
<你要做的事>
end if
End sub