如何显示带有两个按钮的消息框? [英] How can I show a message box with two buttons?
本文介绍了如何显示带有两个按钮的消息框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何显示带有两个按钮的消息框(例如:"on"
、"off"
)?
How can I show a message box with two buttons (For example: "on"
, "off"
)?
推荐答案
你可能想做这样的事情:
You probably want to do something like this:
result = MsgBox ("Yes or No?", vbYesNo, "Yes No Example")
Select Case result
Case vbYes
MsgBox("You chose Yes")
Case vbNo
MsgBox("You chose No")
End Select
添加图标:
result = MsgBox ("Yes or No?", vbYesNo + vbQuestion, "Yes No Example")
其他图标选项:
vbCritical or vbExclamation
这篇关于如何显示带有两个按钮的消息框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文