TX Text Control .NET for Windows Forms

UserName Property

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

Description

Gets 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.

Syntax

public string UserName { get; set; }

Examples

The following example marks selected contract text as editable by the review team by using EditableRegion.UserName.

textControl.Text = "Terms subject to legal review";
textControl.Select(0, textControl.Text.Length);
EditableRegion editableRegion = new("ReviewTeam", 10);
textControl.EditableRegions.Add(editableRegion);

editableRegion.UserName = "Review Team";
if (!string.IsNullOrWhiteSpace(editableRegion.UserName))
{
    Console.WriteLine($"User Name: {editableRegion.UserName}");
}