473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MessageBox to show 2 lines

How do I display 2 lines in the message box?
eg
Click Yes to continue.
Click No to stop.
Aug 23 '06 #1
3 11772
Alan T wrote:
How do I display 2 lines in the message box?
eg
Click Yes to continue.
Click No to stop.
Just put \r\n in the string where you want the linebreak and MessageBox will
oblige when rendering the text, resizing the box as necessary. You can
display an entire screenful of text in a messagebox if you want (but please
don't).

-cd
Aug 23 '06 #2
You should also note that it's better practice to use: Environment.NewLine
instead of /r/n for globalization reasons.

"Carl Daniel [VC++ MVP]" wrote:
Alan T wrote:
How do I display 2 lines in the message box?
eg
Click Yes to continue.
Click No to stop.

Just put \r\n in the string where you want the linebreak and MessageBox will
oblige when rendering the text, resizing the box as necessary. You can
display an entire screenful of text in a messagebox if you want (but please
don't).

-cd
Aug 23 '06 #3
Use like this:

string msg = "Click Yes to Continue..." + System.Environment.NewLine +
"Click No to Stop...";

MessageBox.Show(msg);

--
Nand Kishore Gupta
"Alan T" wrote:
How do I display 2 lines in the message box?
eg
Click Yes to continue.
Click No to stop.
Aug 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Drew Lettington | last post by:
I'm making a simple call to display error messages in a MessageBox from a Windows form and the MessageBox is not behaving in a modal fashion. My modal form displays, the user clicks a button and...
2
by: Scott Vesey | last post by:
In VB, when using the form: MessageBox.Show("some text") The result is a small blank dialog with a blank button. If I specify the full set of parameters for the MessageBox.Show using the...
7
by: Bill | last post by:
For some reason, I have an errormessage popup that "blinks", but pops up BEHIND the applications, which is confusing to users. Is there any way to force it to the top?
5
by: Robert Heuvel | last post by:
Hi, this is what I did: public struct SWaitCursor:IDisposable { public SWaitCursor (int i) { Cursor.Current = Cursors.WaitCursor; } void System.IDisposable.Dispose() { Cursor.Current =...
3
by: Dan | last post by:
I am using Visual Studio .net 2003 (C#) I have a line of code like: messagebox.show("Hello"); I get the erorr message "The type or namespace name 'messagebox' could not be found (are you...
7
by: Pi | last post by:
I have an MDI parent with one or more children forms. Each child form has an engine thread that processes data. The child form's _Closing event is roughly 01 Private Sub...
1
by: Pi | last post by:
I have an MDI parent with one or more children forms. Each child form has an engine thread that processes data. The child form's _Closing event is roughly 01 Private Sub...
4
by: Prabhudhas Peter | last post by:
Can Any one explain me what is the Difference between MsgBox and MessageBox.Show... In VB6 i used MsgBox, So Can I Say "MessageBox.Show" is the new version of MsgBoz which belongs to C# or VB --...
3
by: Kiyomi | last post by:
Hello, I use in my application MessageBox.Show and it works perfectly when I run this application on my local computer (http://localhost). When I diployed this application on the server,...
2
by: Nuno Magalhaes | last post by:
Why does the MessageBox.Show function in the thread below changes the program behaviour, in other words, the APListView becomes filled with values with a call to RefreshAPListView. Without the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.