RichEditControl.PreparePopupMenu Event

Obsolete. Occurs before a context (popup) menu is created for the control's document every time a context menu is being invoked.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v20.1.dll

Declaration

[Browsable(false)]
[Obsolete("You should use the 'PopupMenuShowing' instead", false)]
public event PreparePopupMenuEventHandler PreparePopupMenu
<Browsable(False)>
<Obsolete("You should use the 'PopupMenuShowing' instead", False)>
Public Event PreparePopupMenu As PreparePopupMenuEventHandler

Event Data

The PreparePopupMenu event's data class is DevExpress.XtraRichEdit.PreparePopupMenuEventArgs.

Remarks

Handle the PreparePopupMenu event to modify items in the context menu. The current context menu can be accessed via the PopupMenuShowingEventArgs.Menu property.

The following code snippet illustrates how you can add a custom menu command to the context menu.

using DevExpress.XtraRichEdit.API.Native;
// ...
private void richEditControl1_PopupMenuShowing(object sender, 
        DevExpress.XtraRichEdit.PopupMenuShowingEventArgs  e) {
    e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("MyMenu", 
        new EventHandler(mymenu_Click)));
}
void mymenu_Click(object sender, EventArgs e) {
    MessageBox.Show("test");
}
See Also