windowsforms-devexpress-dot-xtrascheduler-cc528742.md
Represents an individual check item that is displayed within a Scheduler ‘s popup (context) menu.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.dll
NuGet Package : DevExpress.Win.Scheduler
public class SchedulerMenuCheckItem :
CommandMenuCheckItem<SchedulerMenuItemId>,
ISchedulerMenuTagItem
Public Class SchedulerMenuCheckItem
Inherits CommandMenuCheckItem(Of SchedulerMenuItemId)
Implements ISchedulerMenuTagItem
The following members return SchedulerMenuCheckItem objects:
In order for a SchedulerMenuCheckItem to be displayed, it must be added to the DXSubMenuItem.Items property of the SchedulerPopupMenu. To create simple menu items use the instance of the SchedulerMenuItem class instead.
Note
The list of standard check menu items used in the Scheduler is represented by the SchedulerMenuItemId enumeration’s members.
This example demonstrates how to customize the SchedulerControl‘s popup menus (the SchedulerMenuItemId.DefaultMenu in this case). To change particular items in a popup menu handle the SchedulerControl.PopupMenuShowing event of a Scheduler Control.
using DevExpress.XtraScheduler;
// ...
private void schedulerControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
// Check if it's the default menu of a Scheduler.
if (e.Menu.Id == SchedulerMenuItemId.DefaultMenu)
{
// Disable the "New Recurring Appointment" menu item.
e.Menu.DisableMenuItem(SchedulerMenuItemId.NewRecurringAppointment);
// Hide the "New Recurring Event" menu item.
e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewRecurringEvent);
// Enable the "Go To Today" menu item.
e.Menu.EnableMenuItem(SchedulerMenuItemId.GotoToday);
// Find the "New Appointment" menu item and rename it.
SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment);
if (item != null) item.Caption = "&New Event";
}
// Check if it's the appointment menu.
if(e.Menu.Id == SchedulerMenuItemId.AppointmentMenu) {
e.Menu.RemoveMenuItem(SchedulerMenuItemId.LabelSubMenu);
e.Menu.RemoveMenuItem(SchedulerMenuItemId.StatusSubMenu);
}
}
Imports DevExpress.XtraScheduler
' ...
Private Sub schedulerControl1_PopupMenuShowing(ByVal sender As Object, ByVal e As PopupMenuShowingEventArgs)
' Check if it's the default menu of a Scheduler.
If e.Menu.Id = SchedulerMenuItemId.DefaultMenu Then
' Disable the "New Recurring Appointment" menu item.
e.Menu.DisableMenuItem(SchedulerMenuItemId.NewRecurringAppointment)
' Hide the "New Recurring Event" menu item.
e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewRecurringEvent)
' Enable the "Go To Today" menu item.
e.Menu.EnableMenuItem(SchedulerMenuItemId.GotoToday)
' Find the "New Appointment" menu item and rename it.
Dim item As SchedulerMenuItem = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment)
If Not item Is Nothing Then
item.Caption = "&New Event"
End If
End If
' Check if it's the appointment menu.
If e.Menu.Id = SchedulerMenuItemId.AppointmentMenu Then
e.Menu.RemoveMenuItem(SchedulerMenuItemId.LabelSubMenu)
e.Menu.RemoveMenuItem(SchedulerMenuItemId.StatusSubMenu)
End If
End Sub
Object DXMenuItem DXMenuCheckItem DevExpress.Utils.Menu.CommandMenuCheckItem<SchedulerMenuItemId> SchedulerMenuCheckItem
See Also