TX Text Control .NET Server

Clear Method

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

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();
}