473,378 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 16391
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Eric B | last post by:
I am looking for a text control (or API) that can emulate the behavior of CodeWrite where you can move the cursor in any direction on a blank text area and begin typing (so you are not confined to...
4
by: Josh | last post by:
Hi, I'm using System.Data.DataSet.ReadXml to convert some xml from a webservice to a DataSet. The xml looks like: <?xml version="1.0"...
12
by: Nimmy | last post by:
Hi, I have a data file and I want to remove Carriage returns. Any one has any C code/program which does this? I am working on Windows XP machine.....I don't have access to UNIX machine. But I...
5
by: Chad Paquette | last post by:
Hi, We have a legacy cgi app that's written in C. We are encountering an error when we try to retrieve a cgi environment variable. The variable we are getting contains a Base64 encoded...
3
by: Jon | last post by:
Hi... I'm getting stumped over the something that MUST be simple...basically, I'm trying to replace the characters 0D0A with a crlf, using Regex.Replace(). The problem is, the replaced string...
1
by: Jason | last post by:
hi, all, after I read a string from a text file, which contains a hidden character (carriage return) some where in the string, how can I remove this hidden character, because when I populated it...
9
by: santosh | last post by:
Hello all, I've put together a small program to count the number of characters and 'words' in a text file. The minimum length of a word, (in terms of no. of characters), as well as word...
25
by: mdh | last post by:
I wrote a little insignificant program, to help me write a more significant one!!...that was supposed to print all Ascii values from 0 to 127: >>>> #include <stdio.h> # define UPPER_LIMT 127...
11
by: c19h28o2 | last post by:
Hi, Guy's I know there are several posts about this, however I do not want to read them as answers are undoubtedly posted! Here is my attempt but I'm slightly stuck. I'm not looking for the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.