Version

ScrollToCaret Method

Scrolls the contents of the control to the current caret position.
Syntax
'Declaration
 
Public Sub ScrollToCaret() 
public void ScrollToCaret()
Remarks

Note: The ScrollToCaret method will only function correctly when the AlwaysInEditMode property is set to true.

Example
The following code sample demonstrates how to use the ScrollToCaret method to scroll the caret into the viewable area of the control.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinEditors

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.UltraTextEditor1.AlwaysInEditMode = True
        Me.UltraTextEditor1.Multiline = True
        Me.UltraTextEditor1.Scrollbars = ScrollBars.Vertical
        Me.UltraTextEditor1.Text = "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way- in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only."
    End Sub

    Private Sub UltraTextEditor1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles UltraTextEditor1.Enter
        Me.UltraTextEditor1.ScrollToCaret()
    End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinEditors;
using System.Diagnostics;

		private void Form1_Load(object sender, System.EventArgs e)
		{
			this.ultraTextEditor1.AlwaysInEditMode = true;
			this.ultraTextEditor1.Multiline = true;
			this.ultraTextEditor1.Scrollbars = ScrollBars.Vertical;
			this.ultraTextEditor1.Text = "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way- in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only.";
		}

		private void UltraTextEditor1_Enter(object sender, System.EventArgs e)
		{
			this.ultraTextEditor1.ScrollToCaret();		
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also