Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: c# New Line

  1. #1
    New to the CF scene
    Join Date
    Mar 2003
    Location
    UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down c# New Line

    hello

    does anyone know the command for a new line within a message box when using c#.

    thanks in advance
    Bhapy

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,495
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    What is c#?

    This is the Perl forum ... maybe the wrong section?

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    296
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Hi,
    Try the following:

    Code:
    MessageBox.Show("Line 1" + Environment.NewLine + "Line 2");
    OR

    Code:
    MessageBox.Show("Line 1\r\nLine2", "BlahBlah", MessageBoxButtons.OK, MessageBoxIcon.Question);
    OR

    Code:
    string CrLf = "\r\n"; 
    MessageBox.Show("line 1" + CrLf + "line 2");
    Cheers

  • #4
    Banned
    Join Date
    Jun 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "\r\n" almost become the standard for most programming language to represent line break literal

  • #5
    New to the CF scene
    Join Date
    Mar 2003
    Location
    UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank You

    Hello, sorry it took me so long to reply to your post.

    Thank you very much for answering my question I really appreciate it.

    Ciao Craig
    Bhapy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •