469,280 Members | 1,911 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

HELP: Printing carriage return character

Using Visual Basic 6.0

I want the program to be able to print the carriage return.

txtDisplay.Text = "Welcome to" + Chr(13) + "my demo."

All I get is

Welcome to|my demo.

With some strange character instead!

Jul 17 '05 #1
4 16210
Hi Rob,

you need to set the textbox's MultiLine property to true....you can do it at
Design time and in run time.

In run time:
txtDisplay.MultiLine = True

--
Stéphane Richard
Senior Software and Technology Supervisor
http://www.totalweb-inc.com
For all your hosting and related needs
"Rob Lemieux" <lr*******@hotmail.com> wrote in message
news:%P******************@news20.bellglobal.com...
Using Visual Basic 6.0

I want the program to be able to print the carriage return.

txtDisplay.Text = "Welcome to" + Chr(13) + "my demo."

All I get is

Welcome to|my demo.

With some strange character instead!

Jul 17 '05 #2
"Stephane Richard" <st**************@verizon.net> wrote in message
news:ws*****************@nwrdny01.gnilink.net
Hi Rob,

you need to set the textbox's MultiLine property to true....you can
do it at Design time and in run time.

In run time:
txtDisplay.MultiLine = True


Did you try that? I get "can't assign to read-only property"
It has to be set at design time
Jul 17 '05 #3
I got my solution from the sister group "com.lang.basic.visual":

--------------------------------------------------------------------
You need both a carriage return AND a linefeed and the textbox's Multiline
property must be True

txtDisplay.Text = "Welcome to" & Chr$(13) & Chr$(10) & "my demo."
or
txtDisplay.Text = "Welcome to" & vbCRLF & "my demo."
or
txtDisplay.Text = "Welcome to" & vbNewLine & "my demo."

Note that Chr$ is slightly faster than Chr because Chr$ returns a string
directly while Chr returns a string inside a Variant; also, the & operand
is specifically meant for string concatenation and using + can lead to
trouble if you aren't careful about the data types
--------------------------------------------------------------------

"Bob Butler" <ti*******@nospam.com> wrote in message
news:oYGUa.27700$Ne.22545@fed1read03...
"Stephane Richard" <st**************@verizon.net> wrote in message
news:ws*****************@nwrdny01.gnilink.net
Hi Rob,

you need to set the textbox's MultiLine property to true....you can
do it at Design time and in run time.

In run time:
txtDisplay.MultiLine = True


Did you try that? I get "can't assign to read-only property"
It has to be set at design time

Jul 17 '05 #4
On Sat, 26 Jul 2003 21:23:29 -0400, "Rob Lemieux"
<lr*******@hotmail.com> wrote:
Using Visual Basic 6.0

I want the program to be able to print the carriage return.

txtDisplay.Text = "Welcome to" + Chr(13) + "my demo." Is txtDisplay a Textbox ?
If so is it MultiLine ?


All I get is

Welcome to|my demo.

With some strange character instead!


Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Josh | last post: by
12 posts views Thread by Nimmy | last post: by
5 posts views Thread by Chad Paquette | last post: by
3 posts views Thread by Jon | last post: by
1 post views Thread by Jason | last post: by
9 posts views Thread by santosh | last post: by
25 posts views Thread by mdh | last post: by
11 posts views Thread by c19h28o2 | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.