GetTextFields Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Returns an array of TextField objects which are completely contained in this SubTextPart. The objects' type depend on the fieldType parameter.
Syntax
public TextField[] GetTextFields(TextFieldType fieldType);Public Function GetTextFields(fieldType As TextFieldType) As TextField()Parameters
| Parameter | Description |
|---|---|
| fieldType | Specifies types of text fields. It can be a combination of the TextFieldType values. |
Return Value
The return value is null if this SubTextPart has no textfields. Otherwise, it is an array of objects of the type specified through the fieldType parameter.
Examples
The following example marks the selected customer name as a named document region by using SubTextPart.GetTextFields.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
SubTextPart subTextPart = new("CustomerName", 10);
textControl.SubTextParts.Add(subTextPart);
TextField[] results = subTextPart.GetTextFields(TextFieldType.HypertextLink);
foreach (TextField textField in results)
{
Console.WriteLine(textField);
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim subTextPart As New SubTextPart("CustomerName", 10)
textControl.SubTextParts.Add(subTextPart)
Dim results As TextField() = subTextPart.GetTextFields(TextFieldType.HypertextLink)
For Each textField As TextField In results
Console.WriteLine(textField)
Next