GetItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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);Public Function GetItem(id As Integer) As EditableRegionParameters
| Parameter | Description |
|---|---|
| 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();textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim editableRegionCollection As EditableRegionCollection = textControl.EditableRegions
editableRegionCollection.Add(New EditableRegion("ReviewTeam", 100))
Dim result As EditableRegion = editableRegionCollection.GetItem(100)
If result IsNot Nothing Then result.ScrollTo()