Click to See Complete Forum and Search --> : Textbox question


Coco94
November 14th, 2003, 12:15 AM
I'm going to hate myself when i find out what is wrong here.

I have a string variable that I am using to populate a textbox.
I seem to be having a problem with getting a carriage return
/ line feed to append to the textbox.

\t seems to work great to display tabs. but \n and \r only display
garbled text (don't ask me what the technical term for that is).

To set the textbox value, i'm just using textbox.text = string;

pareshgh
November 14th, 2003, 12:48 AM
try textbox's MultiLine to true..
i think it accepts \n \r

Coco94
November 14th, 2003, 09:46 AM
The textbox multiline prop is already set to true.
the code is very simple...

str = "";
str += "[ENTER] \n";
textbox.text = str;

dynamic_sysop
November 14th, 2003, 01:38 PM
\n only works on controls like RichTextBox , in a normal TextBox it only shows a box-like symbol ( which is Chr(10) ) ,try Environment.NewLine.

string str=string.Empty;
string rtn=Environment.NewLine;
str += "[ENTER]" + rtn + "Am i on the next line down?";
textBox1.Text = str;

:)

Coco94
November 14th, 2003, 07:36 PM
Thanks man...you're dynamic....

I tell ya... The .net help has to be the biggest crock
of crap in the development world....totally useless.

Thanks again for the help...