GefContextMenuItem.SetActionToNativeCommand (method)

Makes the menu item trigger a native command.
Syntax: object.SetActionToNativeCommand CommandID
Parameters:
CommandID As GefMenuCommandIDEnum -
Description: The SetActionToNativeCommand method makes the menu item trigger a native menu action when selected. Valid values for the CommandID are values of the GefMenuCommandIDEnum.

Example:

Sub OnPreContextMenu(oContextMenu As GefContextMenu)
  Dim oContextMenuItem As GefContextMenuItem
  Dim oMenuItems As GefContextMenuItems
  
  Set oMenuItems = oContextMenu.MenuItems
  Dim oSubMenu As GefContextMenu
  
  Dim oSubMenuItem As GefContextMenuItem
  Set oContextMenuItem = oMenuItems.Add
  
  oContextMenuItem.MakeSubMenu
  
  oContextMenuItem.Text = "Native menu items"
  
  Set oSubMenu = oContextMenuItem.SubMenu
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToNativeCommand gefMenuCommand_ID_VIEW_MENU
  oSubMenuItem.Text = "&Menu"
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.MakeSeparator
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToNativeCommand gefMenuCommand_ID_VIEW_ZOOM50
  oSubMenuItem.Text = "Zoom 50%"
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToNativeCommand gefMenuCommand_ID_VIEW_ZOOM100
  oSubMenuItem.Text = "Zoom 100%"
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToNativeCommand gefMenuCommand_ID_VIEW_ZOOM200
  oSubMenuItem.Text = "Zoom 200%"
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToNativeCommand gefMenuCommand_ID_VIEW_ZOOM
  oSubMenuItem.Text = "Zoom..."
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToNativeCommand gefMenuCommand_ID_VIEW_FULLSCREEN
  oSubMenuItem.Text = "Full Screen"
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToNativeCommand gefMenuCommand_ID_VIEW_ZOOMTOBESTFIT
  oSubMenuItem.Text = "Zoom to best fit"
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.MakeSeparator
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToNativeCommand gefMenuCommand_ID_VIEW_PREV
  oSubMenuItem.Text = "Previous"
  
  Set oSubMenuItem = oSubMenu.MenuItems.Add
  oSubMenuItem.SetActionToNativeCommand gefMenuCommand_ID_VIEW_HOME_SCREEN
  oSubMenuItem.Text = "Home"
End Sub