By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,283 Members | 1,287 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,283 IT Pros & Developers. It's quick & easy.

Messagebox (NewLine)

P: n/a
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

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Thomas Beyerlein wrote:
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

*** Sent via Developersdex http://www.developersdex.com ***


I think this is what you want:

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

It might be VbCr instead of VbCrLf

Enjoy
Chris
Nov 21 '05 #2

P: n/a
"Thomas Beyerlein" <tb***@yahoo.com> schrieb:
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', ...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

P: n/a
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")
--
--Eric Cathell, MCSA
"Thomas Beyerlein" <tb***@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.