TXTextControl.WPF.ButtonBar Class

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

[C#]
public class ButtonBar : System.Windows.Controls.ToolBar
[Visual Basic]
Public Class ButtonBar
  Inherits System.Windows.Controls.ToolBar

Enumerations

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

Example

The ButtonBar can be configured. The following example removes the Bold button from a ButtonBar:

[C#]
ToggleButton toggleButton = buttonBar1.FindName(ButtonBar.ButtonBarItem.TXITEM_Bold.ToString()) as ToggleButton;
buttonBar1.Items.Remove(toggleButton);
[Visual Basic]
Dim toggleButton As ToggleButton = TryCast(buttonBar1.FindName(ButtonBar.ButtonBarItem.TXITEM_Bold.ToString()), ToggleButton)
buttonBar1.Items.Remove(toggleButton)

See Also