Computer Science Canada

displaying Text in a scrolling text box...

Author:  ZeroPaladn [ Fri Nov 24, 2006 1:26 pm ]
Post subject:  displaying Text in a scrolling text box...

How would you display text in a scrolling text box without either overwriting the existing text inside the text box or just being stuck right beside it? I know that calling...
vb6:
txtDisplay.Text = "woot"
txtDisplay.Text = "lol"

...will just output lol because it will overwrite the existing string inside the text box, but calling...
vb6:
txtDisplay.Text = "lol"
txtDisplay.Text = txtDisplay.Text + " omg"

...will put lol omg, but i want it to jump donw to the next line in the scrolling text box.

thanks guys!

Author:  ZeroPaladn [ Fri Nov 24, 2006 1:32 pm ]
Post subject: 

Sorry for the double post, but i figured it out, i need to use the command vbNewLine while declaring th text of the textbox...
VisualBASIC:
txtDisplay.Text = "lol" + vbNewLine
txtDisplay.Text = txtDisplay.Text + "omg" + vbNewLine

There, now others know how to do it.

Author:  cool dude [ Fri Nov 24, 2006 3:47 pm ]
Post subject: 

ZeroPaladn wrote:
Sorry for the double post, but i figured it out, i need to use the command vbNewLine while declaring th text of the textbox...
VisualBASIC:
txtDisplay.Text = "lol" + vbNewLine
txtDisplay.Text = txtDisplay.Text + "omg" + vbNewLine

There, now others know how to do it.


Glad to see you figured it out. I'll just add for other people that to use vbNewLine you must ensure that the property on your textbox is set to multiline enabled.

Author:  Shaun Dreclin [ Tue Dec 12, 2006 9:46 pm ]
Post subject: 

Embarassed Oh.. The many many times I have spent hours trying to figure out why new lines werent working.. The many many times I realised I forgot to set the text box to multi line.. Embarassed

Author:  cool dude [ Wed Dec 13, 2006 3:25 pm ]
Post subject: 

Shaun Dreclin wrote:
Embarassed Oh.. The many many times I have spent hours trying to figure out why new lines werent working.. The many many times I realised I forgot to set the text box to multi line.. Embarassed


Now you know Wink


: