469,575 Members | 1,618 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,575 developers. It's quick & easy.

Carriage return

How do you code a carriage return in a textbox? For example,

Txtbox1.Text = "My address:" & ?CarriageReturn? & "555 Maple" &
?CarriageReturn? & "Somewhere, USA"

so that the textbox shows the following:

My address:
555 Maple
Somewhere, USA
Nov 20 '05 #1
7 3574
Firstly set the textbox to be multiline... then just + or &
ControlChars.CRLF

as in Txtbox1.Text = "My address:" & ControlChars.CRLF & "555 Maple" &
"Nathan" <nk*********************@softhome.net> wrote in message
news:#m**************@TK2MSFTNGP10.phx.gbl...
How do you code a carriage return in a textbox? For example,

Txtbox1.Text = "My address:" & ?CarriageReturn? & "555 Maple" &
?CarriageReturn? & "Somewhere, USA"

so that the textbox shows the following:

My address:
555 Maple
Somewhere, USA

Nov 20 '05 #2
"Nathan" <nk*********************@softhome.net> schrieb
How do you code a carriage return in a textbox? For example,

Txtbox1.Text = "My address:" & ?CarriageReturn? & "555 Maple" &
?CarriageReturn? & "Somewhere, USA"

so that the textbox shows the following:

My address:
555 Maple
Somewhere, USA


- System.Environment.NewLine
- Microsoft.VisualBasic.Constants.vbNewLine
- Microsoft.VisualBasic.Constants.vbCrLf
- Microsoft.VisualBasic.ControlChars.NewLine
- Microsoft.VisualBasic.ControlChars.CrLf

Also set textbox1.multiline = true
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
In addition to the other posts, you can use Environment.NewLine which is a
platform agnostic way of doing it (not that you'll be running .NET on Unix
anytime soon, but it's worth mentioning).

Cheers,

Bill
"Nathan" <nk*********************@softhome.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
How do you code a carriage return in a textbox? For example,

Txtbox1.Text = "My address:" & ?CarriageReturn? & "555 Maple" &
?CarriageReturn? & "Somewhere, USA"

so that the textbox shows the following:

My address:
555 Maple
Somewhere, USA

Nov 20 '05 #4
* "Nathan" <nk*********************@softhome.net> scripsit:
How do you code a carriage return in a textbox? For example,

Txtbox1.Text = "My address:" & ?CarriageReturn? & "555 Maple" &
?CarriageReturn? & "Somewhere, USA"

so that the textbox shows the following:


Add a 'ControlChars.NewLine' or 'Environment.NewLine' to the string.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb
[nothing new]


Are you sure you still want to keep your news client? ;-)))
--
Armin

Nov 20 '05 #6
Cor
Hi Herfried,
[nothing new]


Are you sure you still want to keep your news client? ;-)))

Cor
Nov 20 '05 #7
* "Cor" <no*@non.com> scripsit:
[nothing new]


[nothing new]


Are you sure you still want to keep your news client?

;-)))

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Canes_Rock | last post: by
4 posts views Thread by Josh | last post: by
2 posts views Thread by Andrew Chanter | last post: by
2 posts views Thread by Matt Mercer | last post: by
3 posts views Thread by Dinsdale | last post: by
11 posts views Thread by evenlater | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.