# IFormattedText.Lines Property

> Gets a collection of all lines the text in the text part consists of. The property value is an object of the type LineCollection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 16.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 > IFormattedText.Lines Property
- **436 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/lines-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/lines-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/lines-property/llms-full.txt

---

### Description

Gets a collection of all lines the text in the text part consists of. The property value is an object of the type [LineCollection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/linecollection/llms-full.txt).

### Syntax

```csharp
LineCollection Lines { get; }
```

```vbnet
ReadOnly Property Lines As LineCollection
```

### Examples

The following example applies bold formatting through the iformatted text's selection by using `IFormattedText.Lines`.

```csharp
Selection formattedSelection = iFormattedText.Selection;
formattedSelection.Bold = true;
iFormattedText.Selection = formattedSelection;

foreach (Line line in iFormattedText.Lines)
{
    Console.WriteLine(line.Baseline);
}
```

```vbnet
Dim formattedSelection As Selection = iFormattedText.Selection
formattedSelection.Bold = True
iFormattedText.Selection = formattedSelection

For Each line As Line In iFormattedText.Lines
    Console.WriteLine(line.Baseline)
Next
```

### Limitations

Read only.

---

## Nearby

- **Previous:** [IFormattedText.Images Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/images-property/llms-full.txt)
- **Next:** [IFormattedText.MisspelledWords Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/misspelledwords-property/llms-full.txt)
