Remove Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Removes the specified form field from a Text Control document.
Syntax
Remove(FormField)
Removes the specified form field from a Text Control document.
public bool Remove(FormField formField);Public Function Remove(formField As FormField) As Boolean| Parameter | Description |
|---|---|
| formField | Specifies the formr field to remove. |
Remove(FormField, bool)
public bool Remove(FormField formField, bool keepText);Public Function Remove(formField As FormField, keepText As Boolean) As BooleanReturn Value
The return value is true, if the form field could be removed. Otherwise it is false.
Examples
The following example works with form fields in the current document by using FormFieldCollection.Remove.
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)
{
FormField formField = formFieldCollection[1];
if (formFieldCollection.Remove(formField))
{
Console.WriteLine("The item was removed.");
}
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim formFieldCollection As FormFieldCollection = textControl.FormFields
formFieldCollection.Add(New CheckFormField(False) With { .Name = "AcceptTerms", .ID = 100 })
If formFieldCollection.Count > 0 Then
Dim formField As FormField = formFieldCollection.Item(1)
If formFieldCollection.Remove(formField) Then
Console.WriteLine("The item was removed.")
End If
End If