How to adjust scroll bar to the end of text in VB6.0 text box?

Time:2020-2-15

In VB, you can add scrollbars to text boxes, but by default, scrollbars need to be manually operated by the user. For the scroll bar that dynamically adds content, we often want to be able to automatically adjust the scroll bar to the end of the text to facilitate the observation of new text content. Today, let’s take a look at vb.60’s skills of automatically setting the scroll bar of the text box to the end through the software. Please see the introduction below for details.

Software name:
Visual Basic 6.0 Lite install
Software size:
5.86MB
Updated:
2014-08-25

1, useTextBox control, draw aTextbox

2. Select the drawn text box and find it in the properties on the right“MultilineAttribute, click the triangle to the right, and select from the list“True”, that is, multi line display. This is a prerequisite for using the vertical scroll bar.

3. Continue to find in the properties of the text box“ScrollBars”Properties, selecting2-Vertical, which is the vertical scroll bar.

4. In the code for theSelStartProperty is set to the length of the text, and the space to heat the text box is named text1, then use:

Text1.SelStart = Len(Text1.Text)

You can set the text box scroll bar to the end.

5. After running the program, you can see that as the text increases, the scroll bar will scroll down, and the text cursor will be set to the end of the text automatically.

The above is the VB6.0 text box to adjust the scroll bar to the end of the text tutorial, I hope you like it, please continue to pay attention to developepaer.

Relevant recommendations:

How to call vb system soft keyboard?

How to make a tabbed window in VB?

How to write VB code to quickly add comments to tables?