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.

Syntax

public class RibbonFormattingTab : System.Windows.Controls.Ribbon.RibbonTab
Public Class RibbonFormattingTab
  Inherits System.Windows.Controls.Ribbon.RibbonTab

Introduced: X12.

Examples

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

TXTextControl.WPF.RibbonFormattingTab ribbonFormattingTab1 = new TXTextControl.WPF.RibbonFormattingTab();

FrameworkElement boldButton = ribbonFormattingTab1.FindName(TXTextControl.WPF.RibbonFormattingTab.RibbonItem.TXITEM_Bold.ToString()) as FrameworkElement;
ItemsControl ic = boldButton.Parent as ItemsControl;
if (ic != null) {
    ic.Items.Remove(boldButton);
    System.Windows.Controls.Ribbon.RibbonButton ribbonButton = new System.Windows.Controls.Ribbon.RibbonButton();
    ribbonButton.Label = "New Button";
    ic.Items.Insert(0, ribbonButton);
}
Dim ribbonFormattingTab1 As New TXTextControl.WPF.RibbonFormattingTab()

Dim boldButton As FrameworkElement = TryCast(ribbonFormattingTab1.FindName(TXTextControl.WPF.RibbonFormattingTab.RibbonItem.TXITEM_Bold.ToString()), FrameworkElement)
Dim ic As ItemsControl = TryCast(boldButton.Parent, ItemsControl)
If ic IsNot Nothing Then
    ic.Items.Remove(boldButton)
    Dim ribbonButton As New System.Windows.Controls.Ribbon.RibbonButton()
    ribbonButton.Label = "New Button"
    ic.Items.Insert(0, ribbonButton)
End If

Enumerations

Enumeration Description
RibbonDropDownItem Each RibbonDropDownItem represents a drop-down item in the RibbonFormattingTab.
RibbonItem Each RibbonItem represents an item in the RibbonFormattingTab that is not a drop-down item.

Properties

Property Description
FindHorizontalSidebar Specifies the name of the horizontal sidebar that is connected to the RibbonFormattingTab's TXITEM_Find button.
FindSidebar Specifies the name of the vertical sidebar that is connected to the RibbonFormattingTab's TXITEM_Find button.
GotoHorizontalSidebar Specifies the name of the horizontal sidebar that is connected to the RibbonFormattingTab's TXITEM_Goto button.
GotoSidebar Specifies the name of the vertical sidebar that is connected to the RibbonFormattingTab's TXITEM_Goto button.
ReplaceHorizontalSidebar Specifies the name of the horizontal sidebar that is connected to the RibbonFormattingTab's TXITEM_Replace button.
ReplaceSidebar Specifies the name of the vertical sidebar that is connected to the RibbonFormattingTab's TXITEM_Replace button.
StylesSidebar Specifies the name of the sidebar that is connected to the RibbonFormattingTab's TXITEM_StyleName's Change Styles drop down item.