Back to Devexpress

Display a Custom Popup Menu

windowsforms-405373-controls-and-libraries-scheduler-examples-menu-display-custom-menu.md

latest1.2 KB
Original Source

Display a Custom Popup Menu

  • Mar 05, 2025

The following example handles the PopupMenuShowing event to display a custom popup menu when the user right-clicks an appointment. The example sets the e.Allow event parameter to false to prevent the built-in menu from appearing.

Note

In this example, a custom popup menu is created and customized at design time.

csharp
void SchedulerControl_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
    if(e.MenuType == DevExpress.XtraScheduler.Views.SchedulerMenuType.AppointmentMenu) {
        e.Allow = false;
        customPopupMenu.ShowPopup(Cursor.Position);
    }
}
vb
Private Sub SchedulerControl_PopupMenuShowing(ByVal sender As Object, ByVal e As PopupMenuShowingEventArgs)
    If e.MenuType = DevExpress.XtraScheduler.Views.SchedulerMenuType.AppointmentMenu Then
        e.Allow = False
        customPopupMenu.ShowPopup(Cursor.Position)
    End If
End Sub

See Also

Customize the Popup Menu