ScrollToCaret Method

ToolStripTextBox.ScrollToCaret Method ()

 

Scrolls the contents of the control to the current caret position.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public void ScrollToCaret()

This method enables you to scroll the contents of the control until the caret is within the visible region of the control. If the caret is positioned below the visible region of the control, the ScrollToCaret method will scroll the contents of the control until the caret is visible at the bottom of the control. If the caret is positioned above the visible region of the control, this method scrolls the contents of the control until the caret is visible at the top of the control. You can use this method in a multiline text box to ensure that the current text entry point is within the visible region of the control.

System_CAPS_noteNote

This method has no effect if the control does not have focus or if the caret is already positioned in the visible region of the control.

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft