# TextControl.OnTextFieldCreated Method

> Raises the TextFieldCreated event.

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

---

### Description

Raises the TextFieldCreated event.

### Syntax

```csharp
protected virtual void OnTextFieldCreated(TextFieldEventArgs e);
```

```vbnet
Protected Overridable Sub OnTextFieldCreated(e As TextFieldEventArgs)
```

### Parameters

| Parameter | Description |
|---|---|
| e | Specifies an [TextFieldEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textfieldeventargs/llms-full.txt) object that contains the event data. |

### Examples

The following example extends Text Control and performs custom processing when On Text Field Created is invoked.

```csharp
class CustomTextControl : TXTextControl.WPF.TextControl
{
    protected override void OnTextFieldCreated(TextFieldEventArgs e)
    {
        // Add custom processing before registered event handlers run.
        base.OnTextFieldCreated(e);
    }
}
```

```vbnet
Class CustomTextControl
    Inherits TXTextControl.WPF.TextControl

    Protected Overrides Sub OnTextFieldCreated(e As TextFieldEventArgs)
        ' Add custom processing before registered event handlers run.
        MyBase.OnTextFieldCreated(e)
    End Sub
End Class
```

### See Also

Text Fields and Hypertext Links - Inserting and Deleting Text Fields.

---

## Nearby

- **Previous:** [TextControl.OnTextFieldClicked Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/ontextfieldclicked-method/llms-full.txt)
- **Next:** [TextControl.OnTextFieldDeleted Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/ontextfielddeleted-method/llms-full.txt)
