TX Text Control .NET for Windows Forms

Selection Property

Property|Introduced in 12.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 current selection in a text frame. The property value is an object of the type Selection. For more information see the description of the Selection class.

Syntax

public Selection Selection { get; set; }

Examples

The following example uses a text frame's selection to insert and emphasize callout text.

TextFrame textFrame = new(new System.Drawing.Size(3000, 1200)) { Name = "Callout", ID = 10 };
textControl.TextFrames.Add(textFrame, TextFrameInsertionMode.DisplaceText);
textFrame.Selection.Text = "Important: submit by Friday.";
textFrame.Selection.Bold = true;