EditableRegion Constructor
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Initializes a new instance of the EditableRegion class.
Syntax
EditableRegion(string, int)
Creates an editable region with the specified user name and/or id. The start and length of the editable region are initialized to zero. When a zero-length editable region is inserted, the current text selection defines it position and length.
public EditableRegion(string userName, int id);Public Sub New(userName As String, id As Integer)| Parameter | Description |
|---|---|
| userName | Specifies the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone. |
| id | Specifies an identifier for the editable region. This parameter can be 0 to indicate, that the editable region has no identifier. |
EditableRegion(string, int, int, int)
Creates an editable region with the specified user name, id, start position and length.
public EditableRegion(string userName, int id, int start, int length);Public Sub New(userName As String, id As Integer, start As Integer, length As Integer)| Parameter | Description |
|---|---|
| userName | Specifies the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone. |
| id | Specifies an identifier for the editable region. This parameter can be 0 to indicate, that the editable region has no identifier. |
| start | Specifies the index (one-based) of the first character which belongs to the editable region. |
| length | Specifies the number of characters which belong to the editable region. |
Examples
The following example marks selected contract text as editable by the review team.
textControl.Text = "Terms subject to legal review";
textControl.Select(0, textControl.Text.Length);
EditableRegion editableRegion = new("ReviewTeam", 10);
textControl.EditableRegions.Add(editableRegion);textControl.Text = "Terms subject to legal review"
textControl.Select(0, textControl.Text.Length)
Dim editableRegion As New EditableRegion("ReviewTeam", 10)
textControl.EditableRegions.Add(editableRegion)