Re: Line break in a windows application

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Nurchi BECHED (nurchi_at_telus.net)
Date: 08/14/04


Date: Sat, 14 Aug 2004 08:50:09 GMT

Hello, Richard!
You wrote on Fri, 13 Aug 2004 13:55:01 -0700:

Thanks for suggestion. It still didn't work.
Something just came up to my mind:
somewhere in the program I converted received data into 'ASCII',
but even when I changed it back to 'Default,' it didn't help...

Thanks

 R> this.TextBox1.AppendText("Hello"+Environment.NewLine+"World");

 R> "Nurchi BECHED" wrote:

 ??>> Hello, All!
 ??>>
 ??>> I have created an application with a multiline textbox on the form.
 ??>> When I press a button, it has to show something and then break
 ??>> the line and show something else.
 ??>> I tried "\n", ((char)13) and ((char)10) - they don't work.
 ??>> When I enter a break by hand (just press enter) and run through
 ??>> each character in that string, the line break character has code
 ??>> 13 10 (yes, 2 numbers for some reason)
 ??>> The possible reason is that 'Enter' is a "control" key (a char with
 ??>> ASCII code less than 32) - they usually return 2 numbers...
 ??>>
 ??>> What should I do to break line in the textbox?
 ??>> Alternative way was to use TextWriter:
 ??>> string LineBreak=(new System.IO.StringWriter()).NewLine;
 ??>>
 ??>> but there must be another way of doing it...
 ??>> and then just use that string:
 ??>> this.TextBox1.AppendText("Hello"+LineBreak+"World");
 ??>>
 ??>> That is kind of stupid...
 ??>>
 ??>> With best regards, Nurchi BECHED.
 ??>>

With best regards, Nurchi BECHED.


Quantcast