Back to Devexpress

SchedulerPopupMenu.GetMenuItemById(SchedulerMenuItemId) Method

windowsforms-devexpress-dot-xtrascheduler-dot-schedulerpopupmenu-dot-getmenuitembyid-x28-devexpress-dot-xtrascheduler-dot-schedulermenuitemid-x29.md

latest3.6 KB
Original Source

SchedulerPopupMenu.GetMenuItemById(SchedulerMenuItemId) Method

Gets a menu item by its ID value.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public SchedulerMenuItem GetMenuItemById(
    SchedulerMenuItemId id
)
vb
Public Function GetMenuItemById(
    id As SchedulerMenuItemId
) As SchedulerMenuItem

Parameters

NameTypeDescription
idSchedulerMenuItemId

A SchedulerMenuItemId enumeration value which specifies the ID value of the menu item to be searched for.

|

Returns

TypeDescription
SchedulerMenuItem

A SchedulerMenuItem object whose ID is equal to the specified ID value. If a menu item with the specified ID isn’t found, then the null ( Nothing in Visual Basic) value will be returned.

|

Remarks

Use the GetMenuItemById method to find a menu item with the specified ID value in the DXSubMenuItem.Items collection of this popup menu. Note that this method finds only the first occurrence of an item with the specified ID.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetMenuItemById(SchedulerMenuItemId) method.

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-scheduler-customize-popup-menu/CS/PopupMenuCustomization/Form1.cs#L46

csharp
// Find the "New Appointment" menu item and rename it.
SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment);
        if (item != null) {

winforms-scheduler-customize-popup-menu/VB/PopupMenuCustomization/Form1.vb#L38

vb
' Find the "New Appointment" menu item and rename it.
Dim item As SchedulerMenuItem = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment)
If item IsNot Nothing Then

See Also

GetPopupMenuById

SchedulerPopupMenu Class

SchedulerPopupMenu Members

DevExpress.XtraScheduler Namespace