469,299 Members | 2,035 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

"\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 2749
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.