TXTextControl.WPF.RibbonFormattingTab Class

The WPF.RibbonFormattingTab class represents a ribbon tab for setting font and paragraph attributes, formatting styles and for handling the clipboard. It is inherited from the System.Windows.Controls.Ribbon.RibbonTab class and must be hosted in a System.Windows.Controls.Ribbon.Ribbon object. It can be connected with a WPF.TextControl through the WPF.TextControl.RibbonFormattingTab property. Each item has a name, available through its Name property, which corresponds with a member of the WPF.RibbonFormattingTab.RibbonItem enumeration. The FrameworkElement.FindName method can be used to get a certain item and manipulate, move or delete it.

Introduced: 22.0.


public class RibbonFormattingTab : System.Windows.Controls.Ribbon.RibbonTab
[Visual Basic]
Public Class RibbonFormattingTab
  Inherits System.Windows.Controls.Ribbon.RibbonTab


Enumeration Description
RibbonItem Each RibbonItem represents an item in a WPF.RibbonFormattingTab.


The RibbonFormattingTab can be configured. The following example removes the Bold button from a RibbonFormattingTab and inserts a simple button instead:

FrameworkElement boldButton = ribbonFormattingTab1.FindName(RibbonFormattingTab.RibbonItem.TXITEM_Bold.ToString()) as FrameworkElement;
ItemsControl ic = boldButton.Parent as ItemsControl;
if (ic != null)
    RibbonButton ribbonButton = new RibbonButton();
    ribbonButton.Label = "New Button";
    ic.Items.Insert(0, ribbonButton);
[Visual Basic]
Dim boldButton As FrameworkElement = TryCast(ribbonFormattingTab1.FindName(RibbonFormattingTab.RibbonItem.TXITEM_Bold.ToString()), FrameworkElement)
Dim ic As ItemsControl = TryCast(boldButton.Parent, ItemsControl)
If ic IsNot Nothing Then
    Dim ribbonButton As New RibbonButton()
    ribbonButton.Label = "New Button"
    ic.Items.Insert(0, ribbonButton)
End If

See Also