Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Adds a new editable region to the document. Its position is defined through the EditableRegion.Start and EditableRegion.Length properties. If the editable region's length is zero, the current text selection is used to define the position.
Syntax
public EditableRegionCollection.AddResult Add(EditableRegion editableRegion);Public Function Add(editableRegion As EditableRegion) As EditableRegionCollection.AddResultParameters
| Parameter | Description |
|---|---|
| editableRegion | Specifies the editable region to add. |
Return Value
The return value specifies whether the new region has successfully been inserted. It can be one of the EditableRegionCollection.AddResult values.
Examples
The following example works with editable regions in the current document by using EditableRegionCollection.Add.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
EditableRegionCollection editableRegionCollection = textControl.EditableRegions;
var result = editableRegionCollection.Add(new EditableRegion("Editor", 100));
Console.WriteLine($"Add result: {result}");textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim editableRegionCollection As EditableRegionCollection = textControl.EditableRegions
Dim result = editableRegionCollection.Add(New EditableRegion("Editor", 100))
Console.WriteLine($"Add result: {result}")