Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Inserts a new standard text field at the current input position.
Syntax
public bool Add(TextField textField);Public Function Add(textField As TextField) As BooleanParameters
| Parameter | Description |
|---|---|
| textField | Specifies the text field to add. |
Return Value
The return value is true, if the text field could be added. Otherwise it is false.
Examples
The following example works with text fields in the current document by using TextFieldCollection.Add.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
TextFieldCollection textFieldCollection = textControl.TextFields;
if (!textFieldCollection.Add(new TextField()))
{
throw new InvalidOperationException("The item could not be inserted.");
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim textFieldCollection As TextFieldCollection = textControl.TextFields
If Not textFieldCollection.Add(New TextField()) Then
Throw New InvalidOperationException("The item could not be inserted.")
End If