Click to See Complete Forum and Search --> : Sending text to a multiline Textbox
laudy
Dec 2nd, 1999, 09:38 PM
Is it possible to append to a multiline textbox during runtime? I want to send periodic messages to the textbox, adding lines as the program is run.
Right now, it just overwrites when I use:
Text2.Text = "some comment"
Thanks.
Serge
Dec 2nd, 1999, 09:41 PM
Sure!
Text1.Text = Text1.Text & vbCrLf & "New Text"
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)
laudy
Dec 2nd, 1999, 09:44 PM
Thats cool, Thanks.
Aaron Young
Dec 3rd, 1999, 02:43 AM
If the Text you display in the Textbox is going to build up to quite a size, you may want to consider adding text using the SelText Property instead.
This allows you to insert text into the Textbox, rather than redefining the entire contents, making it much quicker, eg.
Text1.SelText = "Some Additional Text"
SelText inserts text at the Caret position, so if it's adjustable by the user, you may want to make sure the Caret is at the end of the Textbox before using the SelText Property, ie. Text1.SelStart = Len(Text1)
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
laudy
Dec 3rd, 1999, 02:54 AM
Thanks for the additional method! (The loglines do add up pretty large in size)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.