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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple lines entered into a text box - simple?

Status
Not open for further replies.

CWebster

Programmer
Joined
Jun 12, 2002
Messages
38
Location
GB
Sheesh, this must be easy but I just can't get it to work.

I want to print mulitple lines of text into a text box but all I ever get is the last line. Here's my code:

Counter = 0
For Counter = 1 To 6
Counter = Counter + 1
txtTextArea.Text = Counter
Print ""
Next Counter

The multiline property of txtTextArea is set to True.
 
ok, so I've fixed it - pretty simple really.

Sorry to bother you!
 
Hello CWebster,

If you haven't figured this out already its pretty simple.
Here is whats you would need to do.

For Counter = 1 To 6
txtTextArea.Text = txtTextArea.Text & vbCrLf & Counter
Next Counter

If you need anymore help Let me know.

take it easy,
DeathCloudTWD
 
You might like the txt1.selected text property since it keeps the last set of text available for viewing.

txt1.selectedText = txt1.Text & vbCrLf & Counter

This helps when the data added to the text box runs off the screen.




Jonathan Galpin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top