# InputFormat.StyleNames Property

> Returns an array of the names of all formatting styles, the document contains. This property can be used to fill a combo box or a menu.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 16.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.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 Server > Reference > TXTextControl > InputFormat.StyleNames Property
- **654 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/stylenames-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/stylenames-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/stylenames-property/llms-full.txt

---

### Description

Returns an array of the names of all formatting styles, the document contains. This property can be used to fill a combo box or a menu.

### Syntax

```csharp
public string[] StyleNames { get; }
```

```vbnet
Public ReadOnly Property StyleNames As String()
```

### Examples

The following XAML example shows how to bind the [StyleName](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/stylename-property/llms-full.txt) property to a combo box which contains all style names returned by the StyleNames property.

```plaintext
<ComboBox
    Width="200"
    IsEditable="True"
    IsReadOnly="True"
    Text="{Binding ElementName=textControl1, Path=InputFormat.StyleName}"
    ItemsSource="{Binding ElementName=textControl1, Path=InputFormat.StyleNames}" />
```

The following example changes the formatting applied to text entered at the end of a document by using `InputFormat.StyleNames`.

```csharp
textControl.Text = "Project summary";
textControl.InputPosition = new InputPosition(textControl.Text.Length);
InputFormat inputFormat = textControl.InputFormat;

foreach (string text in inputFormat.StyleNames)
{
    Console.WriteLine(text.Length);
}
```

```vbnet
textControl.Text = "Project summary"
textControl.InputPosition = New InputPosition(textControl.Text.Length)
Dim inputFormat As InputFormat = textControl.InputFormat

For Each text As String In inputFormat.StyleNames
    Console.WriteLine(text.Length)
Next
```

### Limitations

Read only.

---

## Nearby

- **Previous:** [InputFormat.StyleName Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/stylename-property/llms-full.txt)
- **Next:** [InputFormat.Subscript Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/inputformat/subscript-property/llms-full.txt)
