Click or drag to resize

IMenuModel Interface

Version 83.4.2
Supports creation and modification of menus. See CefMenuCommand for the command ids that have default implementations. All user-defined command ids should be between UserFirst and UserFirst. The methods of this class can only be accessed on the CEF UI thread, which by default is not the same as your application UI thread.

Namespace:  CefSharp
Assembly:  CefSharp (in CefSharp.dll) Version: 83.4.2.0 (83.4.2.0)
Syntax
public interface IMenuModel

The IMenuModel type exposes the following members.

Properties
  NameDescription
Public propertyCount
Returns the number of items in this menu.
Top
Methods
  NameDescription
Public methodAddCheckItem
Add a check item to the menu.
Public methodAddItem
Add an item to the menu.
Public methodAddRadioItem
Add a radio item to the menu. Only a single item with the specified groupId can be checked at a time.
Public methodAddSeparator
Add a separator to the menu.
Public methodAddSubMenu
Add a sub-menu to the menu. The new sub-menu is returned.
Public methodClear
Remove all menu items. Can be used to disable the context menu. Returns true on success.
Public methodGetAccelerator
Retrieves the keyboard accelerator for the specified commandId.
Public methodGetAcceleratorAt
Retrieves the keyboard accelerator for the specified index.
Public methodGetCommandIdAt
Returns the command id at the specified index or -1 if not found due to invalid range or the index being a separator.
Public methodGetGroupId
Returns the group id for the specified commandId or -1 if invalid.
Public methodGetGroupIdAt
Returns the group id at the specified index or -1 if invalid.
Public methodGetIndexOf
Returns the index associated with the specified commandId or -1 if not found due to the command id not existing in the menu.
Public methodGetLabel
Returns the label for the specified commandId or empty if not found.
Public methodGetLabelAt
Returns the label at the specified index or empty if not found due to invalid range or the index being a separator.
Public methodGetSubMenu
Returns the IMenuModel for the specified commandId or null if invalid.
Public methodGetSubMenuAt
Returns the IMenuModel at the specified index or empty if invalid.
Public methodGetType
Returns the item type for the specified commandId.
Public methodGetTypeAt
Returns the item type at the specified index.
Public methodHasAccelerator
Returns true if the specified commandId has a keyboard accelerator assigned.
Public methodHasAcceleratorAt
Returns true if the specified index has a keyboard accelerator assigned.
Public methodInsertCheckItemAt
Insert a check item in the menu at the specified index.
Public methodInsertItemAt
Insert an item in the menu at the specified index.
Public methodInsertRadioItemAt
Insert a radio item in the menu at the specified index. Only a single item with the specified groupId can be checked at a time.
Public methodInsertSeparatorAt
Insert a separator in the menu at the specified index.
Public methodInsertSubMenuAt
Insert a sub-menu in the menu at the specified index.
Public methodIsChecked
Returns true if the specified commandId is checked. Only applies to check and radio items.
Public methodIsCheckedAt
Returns true if the specified index is checked. Only applies to check and radio items.
Public methodIsEnabled
Returns true if the specified commandId is enabled.
Public methodIsEnabledAt
Returns true if the specified index is enabled.
Public methodIsVisible
Returns true if the specified commandId is visible.
Public methodIsVisibleAt
Returns true if the specified index is visible.
Public methodRemove
Removes the item with the specified commandId.
Public methodRemoveAccelerator
Remove the keyboard accelerator for the specified commandId.
Public methodRemoveAcceleratorAt
Remove the keyboard accelerator at the specified index.
Public methodRemoveAt
Removes the item at the specified index.
Public methodSetAccelerator
Set the keyboard accelerator for the specified commandId.
Public methodSetAcceleratorAt
Set the keyboard accelerator at the specified index. keyCode can be any key or character value.
Public methodSetChecked
Check the specified commandId. Only applies to check and radio items.
Public methodSetCheckedAt
Check the specified index. Only applies to check and radio items.
Public methodSetCommandIdAt
Sets the command id at the specified index.
Public methodSetEnabled
Change the enabled status of the specified commandId.
Public methodSetEnabledAt
Change the enabled status at the specified index.
Public methodSetGroupId
Sets the group id for the specified commandId.
Public methodSetGroupIdAt
Sets the group id at the specified index.
Public methodSetLabel
Sets the label for the specified commandId.
Public methodSetLabelAt
Set the label at the specified index.
Public methodSetVisible
Change the visibility of the specified commandId.
Public methodSetVisibleAt
Change the visibility at the specified index.
Top
See Also