【发布时间】:2022-10-02 17:03:52
【问题描述】:
我如何能查看如果我单击 MSGbox 中的按钮?
x=msgbox(\"Test\" ,0+16, \"Test\")
我的意思是查看不是如何制作消息框!
-
请检查MsgBox 的返回值
我如何能查看如果我单击 MSGbox 中的按钮?
x=msgbox(\"Test\" ,0+16, \"Test\")
我的意思是查看不是如何制作消息框!
x = msgbox("Test" ,0+16, "Test")
if x = number then
msgbox("Hello world")
end if
而不是 if 语句中的“数字”,写下与您想要检查是否按下的按钮相对应的数字。以下是您可以写的数字:
1 - 好的; 2 - 取消; 3 - 中止; 4 - 重试; 5 - 忽略; 6 - 是的; 7 - 没有
【讨论】:
MsgBox Function。
这是一个例子:
Dim AnswerQuestion,Msg,Title
Title = "Answer the question ?"
Msg = "Do you like cookies? ?"& Vbcr &_
"If yes, then click [YES] button "& Vbcr &_
"If not, then click [NO] button"
AnswerQuestion = MsgBox(Msg,VbYesNo+VbQuestion,Title)
If AnswerQuestion = VbYes then
MsgBox "You clicked on OK Button Good, you're off the hook !",vbInformation,Title
Else
MsgBox "You clicked on No Button ! and You're going to jail !",VbCritical,Title
End if
【讨论】: