|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
How do I make a text box scroll to show last line?
Hi, I have a VB program that processes a database and outputs HTML pages.
I have a simple form with 4 multi-line text boxes that get filled with info so that I can see the progress of my program. I just use text1.text = text1.text + newinfo +chr$(13) + chr$(10) text1.refresh I can see the box get filled up and then the scroll bar gets smaller as more info is put into the text box. How can I make the text box automatically show the lines at the bottom that have just been added? Thanks |
|
#2
|
|||
|
|||
|
Code:
With Text1
.SelStart = Len(.Text)
.SelLength = 0
End With
SelStart is the position of the caret and SelLength is the number of characters that are selected (highlighted). if you put the values the opposite way you would select the entire text box.
__________________
Programmer's Corner |
|
#3
|
||||
|
||||
|
Thank you very much. That's worked a treat
![]() |
|
#4
|
|||
|
|||
|
thank nopoints!
|
|
#5
|
|||
|
|||
|
Other idea:
Just use this piece of code: Private sub Text1_Change() Text1.selstart = len(text1.text) Text1.sellength=0 End sub With this code, you only have to write this code once, and not every time you change the text! |
|
#6
|
|||
|
|||
|
It's a Fast Way!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > How do I make a text box scroll to show last line? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|