TX Text Control .NET for WPF

RemoveFormatting Method

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

Description

Resets all character based formatting attributes of the selected text to its default values. If nothing or more than one paragraph is selected, all paragraph based formatting attributes are also reset.

Syntax

public bool RemoveFormatting();

Return Value

The return value is true, if the operation was successful. Otherwise, it is false.

Examples

The following example formats the heading of a short document by using Selection.RemoveFormatting.

textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;

if (selection.RemoveFormatting())
{
    Console.WriteLine("Remove Formatting completed successfully.");
}