# InlineStyleCollection.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 > InlineStyleCollection.GetItem Method
- **499 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/inlinestylecollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/inlinestylecollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/inlinestylecollection/getitem-method/llms-full.txt

---

### Description

Gets a particular style from the collection.

### Syntax

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

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

### 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 InlineStyle.

### Examples

The following example works with inline styles in the current document by using `InlineStyleCollection.GetItem`.

```csharp
InlineStyleCollection inlineStyleCollection = textControl.InlineStyles;
inlineStyleCollection.Add(new InlineStyle("Emphasis"));

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

```vbnet
Dim inlineStyleCollection As InlineStyleCollection = textControl.InlineStyles
inlineStyleCollection.Add(New InlineStyle("Emphasis"))

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

---

## Nearby

- **Previous:** [InlineStyleCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/inlinestylecollection/copyto-method/llms-full.txt)
- **Next:** [InputFormat Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/inputformat/llms-full.txt)
