Special character in the messagebox

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top