Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MessageBox on Multiple Lines

Status
Not open for further replies.
Apr 6, 2004
33
US
Hello,
Is there a way to have a Messagebox that has multiple lines in it? Here is my current messagebox MessageBox.Show("This program has been disabled, so updates can be made! You will be temporarily locked out until the updates are finished! PLEASE EXIT THE PROGRAM OR THE PROGRAM WILL CLOSE AUTOMATICALLY!") It is all on one line which makes the messagebox very wide.

Thanks in advance
Tim
 
use a vbcrlf to add a new line,

messagebox.show("Line1" & vbcrlf & "line2")

Hope this helps
 
why are you guys responding to a thread that is nearly a year old???????????????

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Just in case someone else searches for the same answer. You should always have at least 10 or 15 equally viable options to accomplish the same task.
 
To be truly platform independant (if .NET ever will be!!!!) you should use Environment.NewLine
 
truly platform independant

I disagree. but no further comment.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Was just going by the documentation. I am interested in knowing why you disagree, not to argue the point (a carriage return/line feed is hardly worth it!!!!) but just out of curiosity.
 
Because every command you make will be translated into the IL and that IL should be platform independent. I can only agree if you want to include API calls but since we don't wich of the above use true managed .net and wich not it will be hard to say wich are truly platform independent. It could be tht environment.newline creates the same IL as controlchars.crlf but I would nee to test that or somebody else and try all the others at the same time to see what they do.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
I would trust both Environment.NewLine and ControlChars.CrLf to be platform independant. I would not trust VBCRLF, or any other legacy VB6 code or methods from the VB namespace. And I agree with Chrissie, anything that is truely .Net (ie: Not VB6/COM with a .Net wrapper) should comile to CLR, then to the natural language of the environment.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Thanks guys - your opinions are very much respected.

Just out of interest, the IL code is:

Environment.NewLine:
call string [mscorlib]System.Environment::get_NewLine()

ControlChars.CrLf:
ldstr "\r\n
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top