TX Text Control .NET for Windows Forms

Selection Property

Property
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 header or footer. 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 the header's selection to insert and format a report title.

HeaderFooterCollection headers = textControl.Sections[1].HeadersAndFooters;
headers.Add(HeaderFooterType.Header);
HeaderFooter headerFooter = headers.GetItem(HeaderFooterType.Header);
headerFooter.Selection.Text = "Quarterly report";
headerFooter.Selection.Bold = true;

Further Reading

  • Using IFormattedText Objects to Access Elements Across All TextParts in a Document –