TX Text Control .NET Server

ScrollTo Method

Method|Introduced in 23.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Sets the current input position to the beginning of a subtextpart and scrolls it into the visible part of the document.

Syntax

public bool ScrollTo();

Return Value

The return value is true, if the subtextpart could be scrolled. Otherwise it is false.

Examples

The following example marks the selected customer name as a named document region by using SubTextPart.ScrollTo.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
SubTextPart subTextPart = new("CustomerName", 10);
textControl.SubTextParts.Add(subTextPart);

if (subTextPart.ScrollTo())
{
    Console.WriteLine("Scroll To completed successfully.");
}