显示 2 行消息弹出窗口 vba 6
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5005188/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
display a 2 row message pop -up vba 6
提问by Radu Puspana
is there a way to display a 2 or 3 or 4 or n line message on a pop-up window in vba 6 ?
有没有办法在 vba 6 的弹出窗口上显示 2 或 3 或 4 或 n 行消息?
For the moment my pop-up window ( calling the MsgBox function) displays the message like this :
目前我的弹出窗口(调用 MsgBox 函数)显示如下消息:
You did something wrong. Please enter valid input.
and I want it to display the message like this
我希望它显示这样的消息
You did something wrong.
Please enter valid input.
can you please provide a code sample?
你能提供一个代码示例吗?
many thx in advance, radu
提前很多谢谢,radu
回答by Hans Olsson
Just add a newline in your message:
只需在您的消息中添加一个换行符:
MsgBox "Text 1" & vbNewLine & "text 2.
回答by Patrick
Relatively easy request
比较简单的要求
iResult = MsgBox("This information is on the first line. " & vbCrLf & "This information is on the 2nd line. " &vbCrLf & _
"Do you wish to continue?", vbYesNo + vbInformation, "Message Box")