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

Add CR/LF to Multiline Text Box 1

Status
Not open for further replies.

SysAdmMke

Technical User
Jan 18, 2006
34
US
Ok.. I am stumped on this one. I want to populate a text box each time a button is pressed but when I do that, it wants to overwrite the same line each time instead of doing a new line.

example:

textbox1.text = name(n)
It puts the name in the text box
then when I increment the array and put the next name in textbox1 it overwrites the name i had in there instead of going down a new line and then printing it.

I have tried


textbox1.text = name(n) + vbnewline
or
textbox1.text = name(n) + Chr(13)

Nothing seems to work.

I have the textbox propertiesset at multiline and wrodwrap off

any clues?

Thanks
Mike


 

Assuming the new text to put in the textbox is in a variable called NewText:

TextBox1.Text &= VBNewLine & NewText

The "&=" operator appends to the string to the left of the operator.


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Thank again jebenson!

Appreciate the help! That worked.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top