# TextControl.GetTextFields Method

> Returns a collection containing text fields of the specified types.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > TextControl.GetTextFields Method
- **385 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/gettextfields-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/gettextfields-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/gettextfields-method/llms-full.txt

---

### Description

Returns a collection containing text fields of the specified types.

### Syntax

```csharp
public TextFieldCollection GetTextFields(TextFieldType fieldType);
```

```vbnet
Public Function GetTextFields(fieldType As TextFieldType) As TextFieldCollection
```

### Parameters

| Parameter | Description |
|---|---|
| fieldType | Specifies types of text fields. It can be a combination of the [TextFieldType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textfieldtype/enumeration/llms-full.txt) values. |

### Return Value

The return value is a collection of all fields of the specified types.

### Examples

The following example retrieves text fields from the text control.

```csharp
var result = textControl.GetTextFields(TextFieldType.HypertextLink);
Console.WriteLine($"Get Text Fields result: {result}");
```

```vbnet
Dim result = textControl.GetTextFields(TextFieldType.HypertextLink)
Console.WriteLine($"Get Text Fields result: {result}")
```

---

## Nearby

- **Previous:** [TextControl.GetSupportedPaperSizes Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/getsupportedpapersizes-method/llms-full.txt)
- **Next:** [TextControl.GetVersionInfo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/getversioninfo-method/llms-full.txt)
