RichEditControl.BarManager Property

Gets or sets the main component that provides the Bars functionality. This is a dependency property.

Namespace: DevExpress.Xpf.RichEdit

Assembly: DevExpress.Xpf.RichEdit.v20.1.dll

Declaration

public BarManager BarManager { get; set; }
Public Property BarManager As BarManager

Property Value

Type Description
BarManager

A BarManager object.

Remarks

The BarManager specifies the container for bars and popup menus. Use this property to enable bar or Ribbon interface of DXRichEdit control.

The BarManager should be initialized when binding it to the RichEditControl. To create bars dynamically, unlink the RichEditControl from BarManager, add the required bars and a bar item and then link RichEditControl to this BarManager, as shown in the code snippet below:

//Unlink the BarManager from the RichEditControl
var barManager = richEditControl1.BarManager;
richEditControl1.BarManager = null;

 //Create new bar items
var bar = new Bar() { Caption = "New Item" };
bar.DockInfo.ContainerType = BarContainerType.Top;
bar.ShowDragWidget = false;
barManager.Bars.Add(bar);
var item = new BarButtonItem();
item.Command = RichEditUICommand.EditCut;
item.CommandParameter = richEditControl1;
bar.ItemLinks.Add(item);
barManager.Items.Add(item);

//Bind the BarManager to the RichEditControl
richEditControl1.BarManager = barManager;
See Also