How do you get a newline in a textbox and string in C# 
Author Message
 How do you get a newline in a textbox and string in C#

Using C# and I have a form, on the form is a TextBox. I am doing some
manipulation of a string that will be assigned to the text property of the
textbox.  In that string, I want to cause a newline to occur in the textbox.
What character or function do I use for this?

Thanks in advance
Rick



Wed, 21 Jul 2004 14:43:33 GMT  
 How do you get a newline in a textbox and string in C#
Sorry for double post. This message is just like the one above. I got an
error when posting this one so I created a new one.


Quote:
> Using C# and I have a form, on the form is a TextBox. I am doing some
> manipulation of a string that will be assigned to the text property of the
> textbox.  In that string, I want to cause a newline to occur in the
textbox.
> What character or function do I use for this?

> Thanks in advance
> Rick



Wed, 21 Jul 2004 14:57:42 GMT  
 How do you get a newline in a textbox and string in C#
try   \n


Quote:
> Using C# and I have a form, on the form is a TextBox. I am doing some
> manipulation of a string that will be assigned to the text property of the
> textbox.  In that string, I want to cause a newline to occur in the
textbox.
> What character or function do I use for this?

> Thanks in advance
> Rick



Wed, 21 Jul 2004 17:06:43 GMT  
 How do you get a newline in a textbox and string in C#
Hi Rick,

Append \r\n to the end of the string for CR/LF.

Hope this helps,

Lee


Quote:
> Using C# and I have a form, on the form is a TextBox. I am doing some
> manipulation of a string that will be assigned to the text property of the
> textbox.  In that string, I want to cause a newline to occur in the
textbox.
> What character or function do I use for this?

> Thanks in advance
> Rick



Wed, 21 Jul 2004 22:08:22 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. textboxes string arrays and the sometimes frustrating art of C#

2. newline in textbox

3. gets without newline?

4. Newline in C#

5. insert newlines into long string

6. string newline replace

7. length of strings w. newlines in them

8. stripping newlines from strings

9. newlines in string constants

10. building a string with newline characters

11. newline in string

12. Adding a newline to a string

 

 
Powered by phpBB® Forum Software