# TextFrame.Selection Property

> Gets or sets the current selection in a text frame. The property value is an object of the type Selection. For more information see the description of the Selection class.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 12.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 WPF > Reference > TXTextControl > TextFrame.Selection Property
- **541 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframe/selection-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframe/selection-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframe/selection-property/llms-full.txt

---

### Description

Gets or sets the current selection in a text frame. The property value is an object of the type [Selection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/selection/llms-full.txt). For more information see the description of the Selection class.

### Syntax

```csharp
public Selection Selection { get; set; }
```

```vbnet
Public Property Selection As Selection
```

### Examples

The following example uses a text frame's selection to insert and emphasize callout text.

```csharp
TextFrame textFrame = new(new System.Drawing.Size(3000, 1200)) { Name = "Callout", ID = 10 };
textControl.TextFrames.Add(textFrame, TextFrameInsertionMode.DisplaceText);
textFrame.Selection.Text = "Important: submit by Friday.";
textFrame.Selection.Bold = true;
```

```vbnet
Dim textFrame As New TextFrame(New System.Drawing.Size(3000, 1200)) With { .Name = "Callout", .ID = 10 }
textControl.TextFrames.Add(textFrame, TextFrameInsertionMode.DisplaceText)
textFrame.Selection.Text = "Important: submit by Friday."
textFrame.Selection.Bold = True
```

---

## Nearby

- **Previous:** [TextFrame.Paragraphs Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframe/paragraphs-property/llms-full.txt)
- **Next:** [TextFrame.SubTextParts Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframe/subtextparts-property/llms-full.txt)
