Back to Devexpress

PopupMenuShowingEventArgs.MenuType Property

windowsforms-devexpress-dot-xtrarichedit-dot-popupmenushowingeventargs-6d64353a.md

latest4.8 KB
Original Source

PopupMenuShowingEventArgs.MenuType Property

Gets a visual element for which the popup menu is invoked.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.XtraRichEdit.v25.2.dll

NuGet Package : DevExpress.Win.RichEdit

Declaration

csharp
public RichEditMenuType MenuType { get; }
vb
Public ReadOnly Property MenuType As RichEditMenuType

Property Value

TypeDescription
RichEditMenuType

A RichEditMenuType enumeration member specifying a visual element to which the context menu is invoked.

|

Available values:

Show 12 items

NameDescription
Text

Specifies a context menu invoked for a text.

| | Hyperlink |

Specifies a context menu invoked for a hyperlink.

| | Field |

Specifies a context menu invoked for a field.

| | TableCell |

Specifies a context menu invoked for a table cell.

| | InlinePicture |

Specifies a context menu invoked for an inline picture.

| | FloatingObject |

Specifies a context menu invoked for a floating object - a picture or text box.

| | TextBox |

Specifies a context menu invoked for a text box.

| | Comment |

Specifies a context menu invoked for a comment.

| | Header |

Specifies a context menu invoked for a header.

| | Footer |

Specifies a context menu invoked for a footer.

| | Footnote |

Specifies a context menu invoked for a footnote.

| | Endnote |

Specifies a context menu invoked for an endnote.

|

Remarks

If the context menu is invoked to any document element except text, the MenuType property returns two bit flags: RichEditMenuType.Text | the RichEditMenuType enumeration value corresponding to the target visual element.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MenuType property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-customize-popup-menu/CS/RichEditContextMenu/Form1.cs#L39

csharp
{
    if ((e.MenuType & RichEditMenuType.TableCell) != 0)
    {

winforms-richedit-customize-popup-menu/VB/RichEditContextMenu/Form1.vb#L35

vb
Private Sub richEditControl_PopupMenuShowing(ByVal sender As Object, ByVal e As PopupMenuShowingEventArgs) Handles richEditControl.PopupMenuShowing
    If (e.MenuType And RichEditMenuType.TableCell) <> 0 Then
        ' Remove the "Paste" menu item:

See Also

PopupMenuShowingEventArgs Class

PopupMenuShowingEventArgs Members

DevExpress.XtraRichEdit Namespace