textbox with MultiLine

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
textbox with MultiLine [Resolved]

i have a textbox with MultiLine set to true and in code line by line things are added to this textbox also ReadOnly is set to true as the user isnt allowed to edit anything, only read and/or copy things to the clipboard

now what i'd like to know is how to have the textbox scroll as new lines are added as in it shows 6 lines at any time and when the 7th line is added it displays line 2 through 7

then when line 8 is added it's now displaying lines 3 through 8

by default the textbox adds lines but the textbox's scrollbars shrink (to show there's more to be seen) but it only displays the top 6 lines

any idea's here?
 
Last edited:
the Textbox.AppendText() method updates the carrot whether the textbox has focus or not which is exactly what i needed
 
Last edited:
That's a better solution, but for future reference, when using ScrollToCaret you simply need to set SelectionStart to Text.Length first, whether the TextBox has focus or not.
 

Latest posts

Back
Top