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!

Scrolling a multiline text box

Status
Not open for further replies.

bashless

Technical User
May 3, 2002
35
US
Hello;

I am writing a visible log file to a multiline text box by appending to the string $ = $ + vbcrlf+ blahblah.

How can I reposition the scroll to the bottom of the text box after I append another line?

Any ideas?

Thx.
 
the text box should have a SelStart property that you could set to the length of the Text property

you may also want to consider adding data to your text box using the SelText property instead of appending data to the Text property
 
No, that did not scroll my text box so the last line is displayed. THanks though I am at least checking for overflow of the 32K string limit now.

Any other ideas???

 

this is crude but works with testing it in formload (make sure that the textbox has the focus)

SendKeys "^+{END}"

(CTRL + END)
 
' add to the .Text property here using whatever makes you happy


' then call this
Text1.SelStart = Len(Text1.Text)

' then, optionally, call this if the above line does not work by itself
Text1.Refresh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top