How to use \n new line in VB msgbox() …?

2020-05-15 14:48发布

What is the alternative to \n (for new line) in a VB.NET MsgBox()?

16条回答
贪生不怕死
2楼-- · 2020-05-15 15:01

msgbox("your text here" & Environment.NewLine & "more text") is the easist way. no point in making your code harder or more ocmplicated than you need it to be...

查看更多
家丑人穷心不美
3楼-- · 2020-05-15 15:04

Try using vbcrlf for a newline

msgbox "This is how" & vbcrlf & "to get a new line"
查看更多
Deceive 欺骗
4楼-- · 2020-05-15 15:06

Add a vbNewLine as:

"text1" & vbNewLine & "text2"
查看更多
狗以群分
5楼-- · 2020-05-15 15:07

Use the command "vbNewLine"

Example

Hello & vbNewLine & "World"

will show up as Hello on one line and World on another

查看更多
我命由我不由天
6楼-- · 2020-05-15 15:12

On my side I created a sub MyMsgBox replacing \n in the prompt by ControlChars.NewLine

查看更多
Root(大扎)
7楼-- · 2020-05-15 15:14

The message box must end with a text and not with a variable

查看更多
登录 后发表回答