TX Text Control .NET for Windows Forms

Clear Method

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

Description

Removes all form fields from a Text Control document.

Syntax

public void Clear();

Examples

The following example works with form fields in the current document by using FormFieldCollection.Clear.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
FormFieldCollection formFieldCollection = textControl.FormFields;
formFieldCollection.Add(new CheckFormField(false) { Name = "AcceptTerms", ID = 100 });

if (formFieldCollection.Count > 0)
{
    formFieldCollection.Clear();
}