Multi-line textbox control - Carriage return?

M

Mike Owen

I am building up an address in a textbox control using c#.

I have set the textmode to multiline, and currently I
just add addlinee1 + " " + addline2 etc., but would like
to format the address lines correctly by adding a
carriage return in between the lines.

Does anybody know what I would add between the lines
using c# so that all the lines are in the same textbox,
but appear on different lines?


Thanks, Mike.
 
A

Alan Corbett \(.NET MVP\)

Yeah, where you have the " ", simple replace with:

SomeTextBox.Text = addlinee1 + "\n" + addline2

\n is the newline character.
 
M

Mike Owen

Thanks Alan, that works a treat!

:)

-----Original Message-----
Yeah, where you have the " ", simple replace with:

SomeTextBox.Text = addlinee1 + "\n" + addline2

\n is the newline character.




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top