Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a new line of text to a text box.

Status
Not open for further replies.

LLANELLI2004

Programmer
Sep 2, 2004
7
0
0
GB
Hi i am working on a program that automatically generates lines of WDL code (3d gamestudio Cscript) this is not much of a problem until i come to add a new line

Is there a way you can make the program place another line of text underneath the previous line EG

this is the first line of code|
this is the second line of code|
the third line of code is longer then the previous|

if somebody can help i would be very greatful
 
Make sure to change the textbox's multiline property to true and you can just keep appending information to it. Here is an example:

Private Sub Command1_Click()
Text1.Text = "Test1"
Text1.Text = Text1.Text & vbNewLine & "Test2"
End Sub

Swi
 
Try:
Text1.SelStart = 65535
Text1.SelText = vbCrLf & "New Lines"

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Neat solution DrJavaJoe. Never thought of doing it that way.

Swi
 
This is the first time this week, but it is only Monday:)

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top