Carriage return in text box? 
Author Message
 Carriage return in text box?

Hi guys....

Well i figured out the binary file thing but now i got a bigger
problem...  How do i enter a carriage return (via code) in VB?

I have a text box which i want to dump information to, but each time i
add data to it the textbox enters the strings in concenating style.

Example:
my code so far makes this output in the textbox
TEXTBOX = "Hello world.  This is a test of two lines"
but i want this
TEXTBOX = " Hello world
This is a test of two lines"

Heelp!  Thanks from a newbie
john blade hewitt



Mon, 12 Aug 2002 03:00:00 GMT  
 Carriage return in text box?
John,

Be sure to set the textbox's Multiline property to True.  You may also want
to set the textbox's Scrollbars property to Vertical.

Then append a carriage return / line feed combination to the text:

Text1.Text = "Hello World" & vbCrLf
Text1.Text = Text1.Text & "This is a test of two lines" & vbCrLf
etc

Or, for your specific example:  Text1.Text = "Hello World" & vbCrLf & "This
is a test of two lines"

Hope this helps,

Kerry Moorman


Quote:
>Hi guys....

>Well i figured out the binary file thing but now i got a bigger
>problem...  How do i enter a carriage return (via code) in VB?

>I have a text box which i want to dump information to, but each time i
>add data to it the textbox enters the strings in concenating style.

>Example:
>my code so far makes this output in the textbox
>TEXTBOX = "Hello world.  This is a test of two lines"
>but i want this
>TEXTBOX = " Hello world
>This is a test of two lines"

>Heelp!  Thanks from a newbie
>john blade hewitt




Mon, 12 Aug 2002 03:00:00 GMT  
 Carriage return in text box?
Thanks Kerry!

It worked :)

Bonza ....



Mon, 12 Aug 2002 03:00:00 GMT  
 Carriage return in text box?
This is fairly straight forward

Just set the multiline property of the textbox to true, then use the VB
constant vbCrLf in your string.

In your example it would be written

" Hello world " & vbcrlf & "This is a test of two lines"

The result would be as you requested

Tom



Quote:
> Hi guys....

> Well i figured out the binary file thing but now i got a bigger
> problem...  How do i enter a carriage return (via code) in VB?

> I have a text box which i want to dump information to, but each time i
> add data to it the textbox enters the strings in concenating style.

> Example:
> my code so far makes this output in the textbox
> TEXTBOX = "Hello world.  This is a test of two lines"
> but i want this
> TEXTBOX = " Hello world
> This is a test of two lines"

> Heelp!  Thanks from a newbie
> john blade hewitt




Tue, 13 Aug 2002 03:00:00 GMT  
 Carriage return in text box?
TEXTBOX = "Hello world" & chr$(13) & chr$(10) & "This is a test of two lines"


Wed, 14 Aug 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Carriage Returns In Text Boxes

2. Carriage Return in text box

3. finding carriage returns in text boxes

4. Carriage Return for Text Box

5. Carriage Return in Text Box

6. Carriage Return in Text Box

7. carriage return in a text box?

8. How to hide linefeed, and carriage return characters in text boxes

9. Inserting a carriage return in a text box

10. Putting a Carriage Return in to a rich text box

11. Carriage return & Text boxes in VB 4.0

12. Carriage Returns in a Text Box

 

 
Powered by phpBB® Forum Software