Skip to main content

RichEditControl.HoverMenuShowing Event

Fires before the hover menu of the control is displayed.

Namespace: DevExpress.Xpf.RichEdit

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

NuGet Package: DevExpress.Wpf.RichEdit


public event HoverMenuShowingEventHandler HoverMenuShowing

Event Data

The HoverMenuShowing event's data class is HoverMenuShowingEventArgs. The following properties provide information specific to this event:

Property Description
Menu Gets or sets the hover menu displayed in the RichEditControl.


Handle the HoverMenuShowing event to modify the default hover menu of the RichEditControl.


The Hover menu is available only when the RichEditControl provides a Bar or Ribbon UI. Otherwise, the HoverMenuShowing event does not occur. To learn how to implement a Bar/Ribbon interface, refer to the Create a Simple Rich Text Editor and Create Separate Command UI for a Rich Text Editor documents.


This code snippet demonstrates how to handle the RichEditControl.HoverMenuShowing event to add and remove menu items. Menu buttons representing the IncrementIndentCommand and the DecrementIndentCommand commands are removed. A new custom command MySmileyCommand, which implements the ICommand interface, is added to the menu.

View Example

Imports System.Windows
Imports DevExpress.Xpf.Bars
Imports DevExpress.Xpf.RichEdit
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.Commands
Imports DevExpress.XtraRichEdit.Menu
Imports DevExpress.Xpf.RichEdit.Menu
        Private Sub richEditControl1_HoverMenuShowing(ByVal sender As Object, ByVal e As HoverMenuShowingEventArgs)
            ' Remove DecreaseIndent and IncreaseIndent command menu items.
            For i As Integer = 0 To e.Menu.ItemsCount - 1
                Dim bLink As BarItemLink = CType(e.Menu.ItemLinks(i), BarItemLink)
                Dim cmd As RichEditUICommand = CType(bLink.Item.Command, RichEditUICommand)
                If cmd.CommandId = RichEditCommandId.DecreaseIndent OrElse cmd.CommandId = RichEditCommandId.IncreaseIndent Then
                End If
            Next i
            ' Add a separator.
            Dim itemSep As New BarItemLinkSeparator()
            ' Create a new menu item and add it to the hover menu.
            Dim item1 As New RichEditMenuItem()
            item1.Content = "Replace Emoticon with Smiley"
            Dim cmd_toAdd As New MySmileyCommand(richEditControl1)
            item1.Command = cmd_toAdd
            item1.Glyph = cmd_toAdd.Glyph
        End Sub
See Also