472,147 Members | 1,281 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,147 software developers and data experts.

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

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
Jan 30 '07 #1
3 2837
I used "\r\n" instead of "\n" and it works.....

"aesper" wrote:
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
Jan 30 '07 #2
On Tue, 30 Jan 2007 11:05:01 -0800, aesper wrote:
I used "\r\n" instead of "\n" and it works.....

"aesper" wrote:
>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
--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 30 '07 #3
Apart from the solution given by Rad, the new line character in Windows
platform contains 0x0D and 0x0A.

Regards,
Raymond

"Rad [Visual C# MVP]" <no****@nospam.comwrote in message
news:n6**************@thinkersroom.com...
On Tue, 30 Jan 2007 11:05:01 -0800, aesper wrote:
>I used "\r\n" instead of "\n" and it works.....

"aesper" wrote:
>>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
--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 31 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Chris Mahoney | last post: by
3 posts views Thread by Sathyaish | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.