Special character in the messagebox

G

Guest

hi,
It might be the simple question. I am concatinating two string and
displaying in messagebox.
Ex:
MessageBox.show(string.Concat("The following validation(s) failed:\n",
arg.DisplayMessage))

But I have overloaded my messageBox for my project style.

When the message is displayed it is displaying one special charcter in
newline character instead of displaying in new line. Is there is anything i
am missing out.
Please let me know.

thanks,
Kannan
 
N

Nicholas Paldino [.NET/C# MVP]

kannan,

I would use the value returned from the NewLine property in the
environment class, like so:

// Show the message box.
MessageBox.Show(string.Format("The following validation(s) failed:{0}{1}",
Environment.NewLine, arg.DisplayMessage));

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top