# ParagraphStyleCollection.GetItem Method

> Gets a particular style from the collection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 10.1
- **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 > ParagraphStyleCollection.GetItem Method
- **510 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/paragraphstylecollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/paragraphstylecollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/paragraphstylecollection/getitem-method/llms-full.txt

---

### Description

Gets a particular style from the collection.

### Syntax

```csharp
public ParagraphStyle GetItem(string styleName);
```

```vbnet
Public Function GetItem(styleName As String) As ParagraphStyle
```

### Parameters

| Parameter | Description |
|---|---|
| styleName | Specifies the name of the style. |

### Return Value

The return value is null, if a style with the specified name is not contained in the collection. Otherwise it is an object of the type ParagraphStyle.

### Examples

The following example works with paragraph styles in the current document by using `ParagraphStyleCollection.GetItem`.

```csharp
ParagraphStyleCollection paragraphStyleCollection = textControl.ParagraphStyles;
paragraphStyleCollection.Add(new ParagraphStyle("ReportHeading"));

var result = paragraphStyleCollection.GetItem("CustomerName");
Console.WriteLine($"Get Item result: {result}");
```

```vbnet
Dim paragraphStyleCollection As ParagraphStyleCollection = textControl.ParagraphStyles
paragraphStyleCollection.Add(New ParagraphStyle("ReportHeading"))

Dim result = paragraphStyleCollection.GetItem("CustomerName")
Console.WriteLine($"Get Item result: {result}")
```

---

## Nearby

- **Previous:** [ParagraphStyleCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/paragraphstylecollection/copyto-method/llms-full.txt)
- **Next:** [PDFImportSettings Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/pdfimportsettings/enumeration/llms-full.txt)
