0

Hi all,

I have a problem with the multi line text box, it executes the "\t" but does not execute "\n".

for example:

outputTextBox.Text ="\t\t ..........\n";

This statement does not execute "\n";

I do not know what the problem is? Can any body tells me?

regards
Khaled

3
Contributors
4
Replies
6
Views
10 Years
Discussion Span
Last Post by Jx_Man
1

outputTextBox.Text ="\t\t ..........\n";

Should be :

outputTextBox.Text ="\t\t ..........[B]\r\n[/B]";
Votes + Comments
Great
0

The text box control only recognizes the system newline, not the language newline, which could be different. Typically '\n' isn't actually multiple characters if the system uses something like CRLF. Instead, whenever '\n' is sent back to the system (through file I/O for example), it's expanded into CRLF.

Jx_Man gave the answer, but C# isn't only restricted to Windows. A more portable solution uses Environment.NewLine:

outputTextBox.Text ="\t\t .........." + Environment.NewLine;
0

outputTextBox.Text ="\t\t .........." + Environment.NewLine;

Great...
i don't have much experience in c#, thx for information narue.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.