TX Text Control .NET for Windows Forms

Apply Method

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

Description

Applies all set attributes of the style to the current document.

Syntax

public bool Apply();

Return Value

The return value is true, if all attributes could be set. Otherwise it is false.

Examples

The following example creates a reusable emphasis style and adds it to the document by using FormattingStyle.Apply.

FormattingStyle formattingStyle = new InlineStyle("Emphasis");

if (formattingStyle.Apply())
{
    Console.WriteLine("Apply completed successfully.");
}

textControl.InlineStyles.Add((InlineStyle)formattingStyle);