|
-
Jan 16th, 2004, 10:11 AM
#1
Thread Starter
Addicted Member
*SOLVED* Adding text to a textbox programmatically
Hi,
Really stupid easy stupid question probably...
I want to add some data to a text box but using code. So I am doing...
Code:
textBox1.AppendText("AddressLine\n\r");
I have added this code to a button, repeated presses make the textbox's contents as follows:
AddressLineAddressLineAddressLine
And then when I count the number of lines it is showing as 3 - however the carriage returns are not working correctly!
Please can somebody help me!
Thanks,
DJ
Last edited by DJ_Catboy; Jan 19th, 2004 at 03:56 AM.
-
Jan 16th, 2004, 11:30 AM
#2
Frenzied Member
is the textboxes multiline property set to true?
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jan 16th, 2004, 11:36 AM
#3
Hyperactive Member
Make sure you added System.Text.RegularExpressions;,
set your textbox to multiline = true (like Memnoch1207 said) and change the order of the Expression. Do \r\n instead of \n\r.
HTH,
Stephan
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
-
Jan 16th, 2004, 11:41 AM
#4
Frenzied Member
you can do it this way
VB Code:
textBox1.Text = textCheck1.Text + "Check" + System.Environment.NewLine;
Or
VB Code:
textBox1.AppendText("Check\r\n");
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jan 16th, 2004, 12:58 PM
#5
PowerPoster
textBox1.Text += "Check" + System.Environment.NewLine;
-
Jan 19th, 2004, 03:56 AM
#6
Thread Starter
Addicted Member
Thank you all for your help!
DJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|