TX Text Control .NET for Windows Forms

Clear Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

Description

Clears the selected text or the character right from the current input position from the Text Control. This method works only if the Text Control has the focus.

Syntax

public void Clear();

Examples

The following example clears the current document only when it contains content.

if (textControl.Text.Length > 0)
{
    textControl.Clear();
}