TX Text Control .NET for WPF

GetItem Method

Method|Introduced in 25.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets the editable region with the specified id. The method returns null, if such a region does not exist. If more than one region with this id exists, the first found region is returned.

Syntax

public EditableRegion GetItem(int id);

Parameters

ParameterDescription
id

Specifies the editable region's identifier. The method returns null if a region with the specified identifier does not exist.

Return Value

The return value is null, if an editable region with the specified parameters could not be found. Otherwise, it is an object of the type EditableRegion.

Examples

The following example works with editable regions in the current document by using EditableRegionCollection.get_Item.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
EditableRegionCollection editableRegionCollection = textControl.EditableRegions;
editableRegionCollection.Add(new EditableRegion("ReviewTeam", 100));

EditableRegion result = editableRegionCollection.GetItem(100);
result?.ScrollTo();