The WPF.ButtonBar class represents a tool bar which can be used to show or to set font and paragraph attributes of a WPF.TextControl. It is inherited from the System.Windows.Controls.ToolBar class, containing default buttons and comboboxes as items, accessible through the Items property. These items can be sorted, deleted or moved through programming code, additional items can be added through programming code or the design time collection editor. Each item has a name, available through its Name property, which corresponds with a member of the WPF.ButtonBar.ButtonBarItem enumeration. The FrameworkElement.FindName method can be used to get a certain item and manipulate, move or delete it.

Syntax

public class ButtonBar : System.Windows.Controls.ToolBar
Public Class ButtonBar
  Inherits System.Windows.Controls.ToolBar

Examples

The ButtonBar can be configured. The following examples show the configuration of ButtonBar. It removes the Bold button from a ButtonBar.

TXTextControl.WPF.ButtonBar buttonBar1 = new TXTextControl.WPF.ButtonBar();

System.Windows.Controls.Primitives.ToggleButton toggleButton = 
    buttonBar1.FindName(TXTextControl.WPF.ButtonBar.ButtonBarItem.TXITEM_Bold.ToString()) as System.Windows.Controls.Primitives.ToggleButton;
buttonBar1.Items.Remove(toggleButton);
Dim buttonBar1 As New TXTextControl.WPF.ButtonBar()

Dim toggleButton As System.Windows.Controls.Primitives.ToggleButton = TryCast(buttonBar1.FindName(TXTextControl.WPF.ButtonBar.ButtonBarItem.TXITEM_Bold.ToString()), _
    System.Windows.Controls.Primitives.ToggleButton)
buttonBar1.Items.Remove(toggleButton)

Enumerations

Enumeration Description
ButtonBarItem Each ButtonBarItem represents an item in a WPF.ButtonBar.