# TextViewGenerator.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 Server
- **Section:** Reference
- **Kind:** Event
- **Introduced:** 26.0
- **Namespace:** `TXTextControl.ServerVisualisation`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Server.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.ServerVisualization > TextViewGenerator.MainTextActivated Event
- **323 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/maintextactivated-event/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/maintextactivated-event/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/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
textViewGenerator.MainTextActivated += (sender, e) =>
{
    Console.WriteLine($"Main Text Activated at {DateTime.Now:u}");
};
```

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

---

## Nearby

- **Previous:** [TextViewGenerator.Location Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/location-property/llms-full.txt)
- **Next:** [TextViewGenerator.OnBarcodeDeselected Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/onbarcodedeselected-method/llms-full.txt)
