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条回答
SAY GOODBYE
2楼-- · 2020-05-15 15:22

A lot of the stuff above didn't work for me. What did end up working is

Chr(13)
查看更多
再贱就再见
3楼-- · 2020-05-15 15:24

The correct format is :

"text1" + vbNewLine + "text2"
查看更多
贪生不怕死
4楼-- · 2020-05-15 15:25

These are the character sequences to create a new line:

  • vbCr is the carriage return (return to line beginning),

  • vbLf is the line feed (go to next line)

  • vbCrLf is the carriage return / line feed (similar to pressing Enter)

I prefer vbNewLine as it is system independent (vbCrLf may not be a true new line on some systems)

查看更多
登录 后发表回答