# SubTextPart.ScrollTo Method

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

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > SubTextPart.ScrollTo Method
- **547 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/subtextpart/scrollto-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/subtextpart/scrollto-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/subtextpart/scrollto-method/llms-full.txt

---

### Description

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

### Syntax

```csharp
public bool ScrollTo();
```

```vbnet
Public Function ScrollTo() As Boolean
```

### 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`.

```csharp
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.");
}
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim subTextPart As New SubTextPart("CustomerName", 10)
textControl.SubTextParts.Add(subTextPart)

If subTextPart.ScrollTo() Then
    Console.WriteLine("Scroll To completed successfully.")
End If
```

---

## Nearby

- **Previous:** [SubTextPart.Save Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/subtextpart/save-method/llms-full.txt)
- **Next:** [SubTextPart.Start Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/subtextpart/start-property/llms-full.txt)
