TX Text Control .NET for WPF

EditableRegion Class

Class|Introduced in 25.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.

Description

An EditableRegion object represents an editable region in a TX Text Control document. When the EditMode property of a Text Control has been set to ReadAndSelect, editable regions can still be edited, either by everyone or depending on the UserName property by a certain user. Each of the main textparts of a document has an EditableRegionCollection which can be used to add and remove editable regions or to save the editable region's text.

Syntax

public class EditableRegion

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);

Members

Constructors

ConstructorDescription
EditableRegionInitializes a new instance of the EditableRegion class.

Properties

PropertyDescription
DefaultHighlightColorGets the default highlight color of an editable region. If the highlight color of an editable region is this default color and a user name is specified, the highlight color is set to a color depending on the user name.
HighlightColorGets or sets the highlight color for the editable region. The color's alpha value must be less than 255 (opaque) so that the editable region's text remains visible. The default value is green with an alpha value of 60. If the highlight color is EditableRegion.DefaultHighlightColor and a user name is specified, the highlight color is set to a color depending on the user name.
HighlightModeGets or sets a value indicating when the editable region is highlighted.
IDGets or sets the editable region's identifier. It must be a one-based value. A value of zero indicates that the editable region has no identifier.
LengthGets the number of characters which belong to the editable region.
NumberGets the editable region's number. The first editable region has the number 1. The number is defined through the textflow. An editable region with a smaller start position has a smaller number.
StartGets the index (one-based) of the first character which belongs to the editable region.
TextGets the editable region's text.
UserNameGets or sets 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.

Methods

MethodDescription
SaveSaves the editable region's text with the specified format.
ScrollToSets the current input position to the beginning of an editable region and scrolls it into the visible part of the document.