"\n" at the end of a TextBox line displays as a small []

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a windows forms application with a TextBox display. I use the
following code to display a line in the TextBox:

......
statusTextBox.AppendText(message + "\n");
.......

I just want the text box to insert a new line after the message, it does
insert the new line but the [] always appears in the text box.
How can I add a new line without displaying []??
Any help is appreciated.

Thanks,

Esper
 
I used "\r\n" instead of "\n" and it works.....

aesper said:
I have a windows forms application with a TextBox display. I use the
following code to display a line in the TextBox:

.....
statusTextBox.AppendText(message + "\n");
......

I just want the text box to insert a new line after the message, it does
insert the new line but the [] always appears in the text box.
How can I add a new line without displaying []??
Any help is appreciated.

Thanks,

Esper

Or better yet, Environment.Newline
 
Apart from the solution given by Rad, the new line character in Windows
platform contains 0x0D and 0x0A.

Regards,
Raymond

Rad said:
I used "\r\n" instead of "\n" and it works.....

aesper said:
I have a windows forms application with a TextBox display. I use the
following code to display a line in the TextBox:

.....
statusTextBox.AppendText(message + "\n");
......

I just want the text box to insert a new line after the message, it does
insert the new line but the [] always appears in the text box.
How can I add a new line without displaying []??
Any help is appreciated.

Thanks,

Esper

Or better yet, Environment.Newline
 
Back
Top