Xceed Toolkit Plus for WPF v5.0 Documentation
Xceed.Wpf.Toolkit Assembly / Xceed.Wpf.Toolkit Namespace / RichTextBoxFormatBar Class
Members Example


In This Topic
    RichTextBoxFormatBar Class
    In This Topic
    Represents a contextual formatting toolbar that mimics the behavior of the Microsoft Office 2010 formatting bar.
    Syntax
    'Declaration
     
    <StyleTypedPropertyAttribute(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)>
    <XmlLangPropertyAttribute("Language")>
    <UsableDuringInitializationAttribute(True)>
    <RuntimeNamePropertyAttribute("Name")>
    <UidPropertyAttribute("Uid")>
    <TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>
    <NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>
    Public Class RichTextBoxFormatBar 
       Inherits System.Windows.Controls.Control
       Implements IRichTextBoxFormatBar 
    'Usage
     
    Dim instance As RichTextBoxFormatBar
    [StyleTypedProperty(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)]
    [XmlLangProperty("Language")]
    [UsableDuringInitialization(true)]
    [RuntimeNameProperty("Name")]
    [UidProperty("Uid")]
    [TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)]
    [NameScopeProperty("NameScope", System.Windows.NameScope)]
    public class RichTextBoxFormatBar : System.Windows.Controls.Control, IRichTextBoxFormatBar  
    Remarks

    The RichTextBoxFormatBar will apply text transformations to the selected text of a RichTextBox control. The RichTextBoxFormatBar will appear after a selection has been finished (when the mouse is released). The RichTextBoxFormatBar will also appear during the last click of a "double-click" selection. While the RichTextFormatBar is shown, you may click on any number of text transformations to be applied to the selected text. When done, you may click anywhere else in the RichTextBox control or move your mouse outside of the RichTextBox control to hide the RichTextBoxFormatBar. You can also drag the RichTextBoxFormatBar to a different position if it appears in a position that is not desired by clicking and holding on the drag thumb and moving your mouse to the desired location.

    The RichTextBoxFormatBar can be attached to any RichTextBox control (either the toolkit's RichTextBox or the default .NET RichTextBox) by using the RichTextBoxFormatBarManager. You can even create your own formatting bar and use it instead, but still have all the functionality the RichTextboxFormatBarManager provides.

    You can create your own custom format bar by creating a control that implements the IRichTextBoxFormatBar interface and setting the RichTextBoxFormatBarManager.FormatBar attached property to your new custom format bar instance.

    Example
    The following example adds the RichTextBoxFormatBar to the toolkit's RichTextBox.
    <xctk:RichTextBox>
           <xctk:RichTextBoxFormatBarManager.FormatBar>
               <xctk:RichTextBoxFormatBar />
           </xctk:RichTextBoxFormatBarManager.FormatBar>
    </xctk:RichTextBox>
    The following snippet addsthe RichTextBoxFormatBar to the default Windows RichTextBox.
    <RichTextBox>
           <xctk:RichTextBoxFormatBarManager.FormatBar>
               <xctk:RichTextBoxFormatBar />
           </xctk:RichTextBoxFormatBarManager.FormatBar>
    </RichTextBox>
    You create your own custom format bar by creating a custom/user control that implements the IRichTextBoxFormatBar interface and setting the RichTextBoxFormatBarManager.FormatBar attached property to your new custom format bar instance.
    <RichTextBox>
           <xctk:RichTextBoxFormatBarManager.FormatBar>
               <local:MyCustomFormatBar />
           </xctk:RichTextBoxFormatBarManager.FormatBar>
    </RichTextBox>
    Inheritance Hierarchy

    System.Object
       System.Windows.Threading.DispatcherObject
          System.Windows.DependencyObject
             System.Windows.Media.Visual
                System.Windows.UIElement
                   System.Windows.FrameworkElement
                      System.Windows.Controls.Control
                         Xceed.Wpf.Toolkit.RichTextBoxFormatBar

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also