Messagebox (NewLine)

  • Thread starter Thread starter Thomas Beyerlein
  • Start date Start date
T

Thomas Beyerlein

Is there a way to put some of the text typed into a messagebox string on
a new line? This is for user readability only.

Thanks
Tom
 
Thomas said:
Is there a way to put some of the text typed into a messagebox string on
a new line? This is for user readability only.

Thanks
Tom

I think this is what you want:

MessageBox.Show("Line 1" & vbcrlf & vbcrlf & "Line 2")

It might be VbCr instead of VbCrLf

Enjoy
Chris
 
Thomas Beyerlein said:
Is there a way to put some of the text typed into a messagebox string on
a new line? This is for user readability only.


\\\
MsgBox("Hello" & ControlChars.NewLine & "World!")
///

Alternatively you can use 'vbNewLine', 'Environment.NewLine', 'vbCrLf', ...
 
These other examples work, I have found though recently the stringbuilder
class. It works verywell for this, and allows for alot more customization
and control on the text formatting.

dim message as stringbuilder

message.appendformat("Hello {0}!",username)
message.append(environment.newline)
message.appendformat("{0}, what are you doing {0}?",username)
message.append(environment.newline)
message.appendformat("{0}, I will kill you {0}!",username)

messagebox.show(message.tostring,"HAL9000")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top