# TextFrameCollection.GetActivatedItem Method

> Returns the currently activated text frame. An activated text frame has the input focus and can be edited. The method returns null, if no text frame is activated.

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

---

### Description

Returns the currently activated text frame. An activated text frame has the input focus and can be edited. The method returns null, if no text frame is activated.

### Syntax

```csharp
public TextFrame GetActivatedItem();
```

```vbnet
Public Function GetActivatedItem() As TextFrame
```

### Return Value

The return value is null, if an activated text frame could not be found. Otherwise, it is an object of the type [TextFrame](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textframe/llms-full.txt).

### Examples

The following example works with text frames in the current document by using `TextFrameCollection.GetActivatedItem`.

```csharp
TextFrameCollection textFrameCollection = textControl.TextFrames;
textFrameCollection.Add(new TextFrame(new System.Drawing.Size(3000, 1200)) { Name = "Callout", ID = 100 }, TextFrameInsertionMode.DisplaceText);

var result = textFrameCollection.GetActivatedItem();
Console.WriteLine($"Get Activated Item result: {result}");
```

```vbnet
Dim textFrameCollection As TextFrameCollection = textControl.TextFrames
textFrameCollection.Add(New TextFrame(New System.Drawing.Size(3000, 1200)) With { .Name = "Callout", .ID = 100 }, TextFrameInsertionMode.DisplaceText)

Dim result = textFrameCollection.GetActivatedItem()
Console.WriteLine($"Get Activated Item result: {result}")
```

---

## Nearby

- **Previous:** [TextFrameCollection.DeactivateItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textframecollection/deactivateitem-method/llms-full.txt)
- **Next:** [TextFrameCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textframecollection/getitem-method/llms-full.txt)
