# TextControl.MainTextActivated Event

> Occurs when the main text of the document gets the current text input position from another part of the document, such as a header, a footer or a textframe. The event handler receives an argument of type EventArgs containing data related to this event.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Event
- **Introduced:** 26.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.MainTextActivated Event
- **321 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/maintextactivated-event/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/maintextactivated-event/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/maintextactivated-event/llms-full.txt

---

### Description

Occurs when the main text of the document gets the current text input position from another part of the document, such as a header, a footer or a textframe. The event handler receives an argument of type EventArgs containing data related to this event.

### Syntax

```csharp
public event EventHandler MainTextActivated;
```

```vbnet
Public Event MainTextActivated As EventHandler
```

### Examples

The following example records useful context when main text activated occurs.

```csharp
textControl.MainTextActivated += (sender, e) =>
{
    Console.WriteLine($"Main Text Activated at {DateTime.Now:u}");
};
```

```vbnet
AddHandler textControl.MainTextActivated,
    Sub(sender, e)
        Console.WriteLine($"Main Text Activated at {DateTime.Now:u}")
    End Sub
```

---

## Nearby

- **Previous:** [TextControl.Load Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/load-method/llms-full.txt)
- **Next:** [TextControl.ManageConditionalInstructionsDialog Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/manageconditionalinstructionsdialog-method/llms-full.txt)
