TX Text Control .NET for Windows Forms

ButtonBar Class

Class
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Windows.Forms.dll
Install
dotnet add package TXTextControl.TextControl.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.Windows.Forms.dll from the setup.
Inherits
  1. Control
  2. ButtonBar

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

public class ButtonBar : Control

Examples

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

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.

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

Members

Constructors

ConstructorDescription
ButtonBarNot described in the reference. public ButtonBar();

Properties

PropertyDescription
BorderStyleGets or sets the border style of the button bar.
ButtonOffsetsGets or sets an array of additional offsets, in pixels, between the buttons. The maximum size of the array is 31.
ButtonPositionsGets or sets an array of buttons the button bar consists of. The maximum size of the array is 31 buttons.
ButtonSeparatorsGets 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.
ButtonStyleGets or sets the painting style of the buttons.
DisplayColorsGets 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.
ReadOnlyGets 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.

Methods

MethodDescription
ResetButtonOffsetsResets the offset array to its default state.
ResetButtonPositionsResets the button array to its default state.
ResetButtonSeparatorsResets the separator array to its default state.
ResetDisplayColorsResets all display colors of a button bar to their system dependent default values.