A Conversation for The H2G2 Programmers' Corner

putting lines breaks into text in Visual Basic 6

Post 1

Din'Amarth, Keeper of all bad jokes, exept those which are stunningly bad.

I need to know how to put line breaks in text in Visual Basic 6. I can't find my library CD thingy with the help files, and the online help is extremely difficult to use. Thanks.

~~Din'


Better yet...

Post 2

Din'Amarth, Keeper of all bad jokes, exept those which are stunningly bad.

Better yet, what I really need to know is how to make a text box type thing that moves everything down and puts the new thing at the top whenever any new text is added to the box. My idea for doing this would something like this: (with whatever makes a line break instead of <line break&gtsmiley - winkeye

text1.text="new text"++"______________"+ +text1.text

Hopefully this would look like

new text
______________
old text

If there is an easier way to do this I would be very appreciative to hear it.


~~Din'


Better yet...

Post 3

26199

Well, I'm guessing, but what you prob'ly want is ASCII character 13 and/or 10. There are probably escape codes, but in most versions of basic you can also type chr(13), or something along those lines...


Better yet...

Post 4

Din'Amarth, Keeper of all bad jokes, exept those which are stunningly bad.

When I do that it puts up a thickish vertical line. Are you sure that 13 is the right number?


~~Din'


Better yet...

Post 5

Jonny

I think so, but the constant for it is vbCrLf (standing for VB character Line Feed). So if you have:

Text1.Text= "Hello" & vbCrLF & "World"

You get the output

Hello
World


Better yet...

Post 6

DoctorMO (Keeper of the Computer, Guru, Community Artist)

Perfect, I always seem to be late...

(Unless your planning on sending things to Linux, Amigas or Macs, like I did with a serial link, opps)

-- DoctorMO --


Key: Complain about this post