# FormattingStyleCollection Class

> The FormattingStyleCollection class is the base class of the ParagraphStyleCollection and InlineStyleCollection classes. It implements their base functionality and the IEnumerable and the ICollection interface.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 10.1
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Derived:** `TXTextControl.InlineStyleCollection`, `TXTextControl.ParagraphStyleCollection`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > FormattingStyleCollection Class
- **724 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstylecollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstylecollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstylecollection/llms-full.txt

---

### Description

The FormattingStyleCollection class is the base class of the [ParagraphStyleCollection](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/paragraphstylecollection/llms-full.txt) and [InlineStyleCollection](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/inlinestylecollection/llms-full.txt) classes. It implements their base functionality and the IEnumerable and the ICollection interface.

### Syntax

```csharp
public abstract class FormattingStyleCollection : ICollection, IEnumerable
```

```vbnet
Public MustInherit Class FormattingStyleCollection
    Implements ICollection, IEnumerable
```

### Examples

The following example includes the count value from a Formatting Style Collection object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Count: {formattingStyleCollection.Count}");
Console.WriteLine("Formatting Style Collection is ready for use.");
```

```vbnet
Console.WriteLine($"Count: {formattingStyleCollection.Count}")
Console.WriteLine("Formatting Style Collection is ready for use.")
```

---

## In This Section

- [FormattingStyleCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstylecollection/count-property/llms-full.txt): Gets the number of elements contained in the collection.
- [FormattingStyleCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstylecollection/getenumerator-method/llms-full.txt): Returns an enumerator that can be used to iterate through the collection.
- [FormattingStyleCollection.IsSynchronized Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstylecollection/issynchronized-property/llms-full.txt): Returns true if the collection is designed to be thread safe, otherwise, it returns false.
- [FormattingStyleCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstylecollection/remove-method/llms-full.txt): Removes a formatting style from a Text Control document.
- [FormattingStyleCollection.SyncRoot Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstylecollection/syncroot-property/llms-full.txt): Gets an object that can be used to synchronize access to the collection.

---

## Nearby

- **Previous:** [FormattingStyle.Underline Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstyle/underline-property/llms-full.txt)
- **Next:** [FormattingStyleCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formattingstylecollection/count-property/llms-full.txt)
