How to Enter Multiple Lines of text in Message Box

In Message Box i want to display multiple lines of text.

Use Environment.NewLine as newline separator

1 Like

Hi,

Use vbCrLf to display text in new line.

image

Regards,
Rahamat

16 Likes

using Environment.NewLine worked, thanks

+vbclrf+ didn’t work for me, had to use Environment.newline.

It worked fine for me. Thanks for the tip.

1 Like

Both of them are working fine, even in the same line.
name.ToString+vbCrLf+phone.ToString+Environment.NewLine+company.ToString

Name
Phone
Company name

@Fateh - both will work identically in windows. However, it is generally recommended to use Environment.NewLine instead of the vbCrLf (standing for Visual Basic Carriage Return + Line Feed). This is because Environment.NewLine works for all operating systems and applications and is therefore more robust. In my opinion it’s a lot more readable as well

3 Likes

How can we display message in next line with variable?