Back to Devexpress

RibbonControl.ContextMenu Property

windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-ribboncontrol-8d9f81a4.md

latest2.1 KB
Original Source

RibbonControl.ContextMenu Property

Overrides the ContextMenu property.

Namespace : DevExpress.XtraBars.Ribbon

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
public override ContextMenu ContextMenu { get; set; }
vb
<Browsable(False)>
Public Overrides Property ContextMenu As ContextMenu

Property Value

TypeDescription
ContextMenu

A ContextMenu object.

|

Remarks

Typically there is no need to assign a single context menu to a RibbonControl, as the control consists of multiple elements, and you may wish to invoke different menus for different elements. Therefore, the ContextMenu property is overridden to hide it at design time.

You can provide different popup menus for the control’s elements by handling specific events. For example, you can handle the MouseDown event. In this event handler, check which element has been clicked by calling the RibbonControl.CalcHitInfo method, and if the required element has been clicked, display a specific menu by calling its Show method.

See Also

PopupMenu

RibbonControl Class

RibbonControl Members

DevExpress.XtraBars.Ribbon Namespace