need to display multiplelines using messagebox

hi,

i need to diplay the text in multiplelines in messagebox.Help me with this.

thanks

venp




Answer this question

need to display multiplelines using messagebox

  • redneon

    the initial response given works

  • Matthias Frener

    sorry for the confusion.

    I meant to ask David Jeavons about this command

    MessageBox.Show("Line 1" & ControlChars.Lf & "Line 2" & ControlChars.Lf & "Line 3")

    whether the above cmd works in c#.

    ahmedilyas'c cmd is working. thanks



  • acccollin

    I'm not getting ControlChars in my intellisense..what i have to include for reference other than microsoft.visualbasic

    venp



  • Celios

    well that is pretty much equiv to \r\n (line field) - \r\n is a carriage return I believe.

  • harkat1

    HI

    If you are using C# then you should go with the initial response given by ahmedilyas. I certainly wouldn't want to import the Microsoft.VisualBasic Namespace into a C# project unless I had a really good reason too, and this isn't one of them.


  • Suganya Mahadevan

    Okay then, I'll proceed with ahmedilyas cmd.Thanks for me helping with this.

    Thanks

    venp



  • Jeff Sholl

    Environment.NewLine or \r\n will work :-) Example:

    MessageBox.Show("hello\r\nMy name is bob");



  • Moksi

    Does this command work in c#.

    I included microsoft.visualbasic but it doesnt work.

    venp



  • robinjam

    Hi

    You can introduce line breaks within your message box using the line feed or carriage return characters as so:

    MessageBox.Show("Line 1" & ControlChars.Lf & "Line 2" & ControlChars.Lf & "Line 3")

    Is this what you meant

     

    HTH

    Edit: Sorry for the cross post.


  • Leon.I

    even though both solutions are valid (as always, replies are welcomed!) it is best to use the language's syntax instead of importing another language into the language you are using for many reasons, including this.

    So which ever language you are using, use its functions/syntax than trying to import from another one....



  • need to display multiplelines using messagebox