# ButtonBar Class

> The ButtonBar class represents a Windows Forms tool bar which can be used to show or to set font and paragraph attributes of a Windows Forms TextControl. It is inherited from the System.Windows.Forms.Control class. The following describes only the properties, methods and events defined through the ButtonBar class. For a list of properties, methods and events inherited from the System.Windows.Forms.Control class see the .NET Framework reference.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Inherits:** `System.Windows.Forms.Control`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > ButtonBar Class
- **1241 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/llms-full.txt

---

### Description

The ButtonBar class represents a Windows Forms tool bar which can be used to show or to set font and paragraph attributes of a Windows Forms [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/llms-full.txt). It is inherited from the `System.Windows.Forms.Control` class. The following describes only the properties, methods and events defined through the `ButtonBar` class. For a list of properties, methods and events inherited from the `System.Windows.Forms.Control` class see the .NET Framework reference.

### Syntax

```csharp
public class ButtonBar : Control
```

```vbnet
Public Class ButtonBar
    Inherits Control
```

### Examples

The following example shows how to set up a ButtonBar with just 2 specific buttons.

```csharp
buttonBar1.ButtonPositions = new TXTextControl.Button[] {
                             TXTextControl.Button.FontBoldButton,
                             TXTextControl.Button.FontItalicButton };
```

```vbnet
ButtonBar1.ButtonPositions = New TXTextControl.Button() { _
                             TXTextControl.Button.FontBoldButton, _
                             TXTextControl.Button.FontItalicButton }
```

The following example creates a Button Bar instance and configures its border style setting for a document workflow.

```csharp
using ButtonBar buttonBar = new();
buttonBar.BorderStyle = ButtonBarBorderStyle.Simple3D;
```

```vbnet
Dim buttonBar As New ButtonBar()
buttonBar.BorderStyle = ButtonBarBorderStyle.Simple3D
```

---

## In This Section

- [ButtonBar.BorderStyle Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/borderstyle-property/llms-full.txt): Gets or sets the border style of the button bar.
- [ButtonBar.ButtonOffsets Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/buttonoffsets-property/llms-full.txt): Gets or sets an array of additional offsets, in pixels, between the buttons. The maximum size of the array is 31.
- [ButtonBar.ButtonPositions Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/buttonpositions-property/llms-full.txt): Gets or sets an array of buttons the button bar consists of. The maximum size of the array is 31 buttons.
- [ButtonBar.ButtonSeparators Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/buttonseparators-property/llms-full.txt): Gets or sets an array of boolean values specifying whether or not a separator is drawn between two buttons. The maximum size of the array is 31.
- [ButtonBar.ButtonStyle Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/buttonstyle-property/llms-full.txt): Gets or sets the painting style of the buttons.
- [ButtonBar.DisplayColors Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/displaycolors-property/llms-full.txt): Gets or sets the colors of the button bar. These colors are only used when the BorderStyle and ButtonStyle properties have been set to ColorScheme. The property value is an object of the type ButtonBar.Colors.
- [ButtonBar.ReadOnly Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/readonly-property/llms-full.txt): Gets or sets a value determining the button bar's read only mode. When the button bar is set to read only, it still shows all formatting attributes of the connected TextControl, but formatting attributes cannot be changed.
- [ButtonBar.ResetButtonOffsets Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/resetbuttonoffsets-method/llms-full.txt): Resets the offset array to its default state.
- [ButtonBar.ResetButtonPositions Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/resetbuttonpositions-method/llms-full.txt): Resets the button array to its default state.
- [ButtonBar.ResetButtonSeparators Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/resetbuttonseparators-method/llms-full.txt): Resets the separator array to its default state.
- [ButtonBar.ResetDisplayColors Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/resetdisplaycolors-method/llms-full.txt): Resets all display colors of a button bar to their system dependent default values.

---

## Nearby

- **Previous:** [BookmarkDialog.FindItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/bookmarkdialog/finditem-method/llms-full.txt)
- **Next:** [ButtonBar.BorderStyle Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/buttonbar/borderstyle-property/llms-full.txt)
