Adds a new menuitem to the menu. | |
Syntax: | Set GefContextMenuItem = object.Add ( ) |
Description: | Example: Sub OnMyMenu4 MsgBox "OnMyMenu4" End Sub Sub OnMyMenu3 MsgBox "OnMyMenu3" End Sub Sub OnMyMenu2 MsgBox "OnMyMenu2" End Sub Sub OnPreContextMenu(oContextMenu As
GefContextMenu) Dim oContextMenuItem0 As
GefContextMenuItem Dim oContextMenuItem As
GefContextMenuItem Dim oContextMenuItem1 As
GefContextMenuItem Dim oMenuItems As GefContextMenuItems Set oMenuItems =
oContextMenu.MenuItems oMenuItems.RemoveAll Set oContextMenuItem0 = oMenuItems.Add oContextMenuItem0.SetActionToScript
"OnMyMenu4" oContextMenuItem0.Text = "OnMyMenu4" oContextMenuItem0.Enabled = False Set oContextMenuItem = oMenuItems.Add oContextMenuItem.SetActionToScript
"OnMyMenu2" oContextMenuItem.Text = "OnMyMenu2" oContextMenuItem.Checked = True Set oContextMenuItem = oMenuItems.Add oContextMenuItem.SetActionToScript
"OnMyMenu3" oContextMenuItem.Text = "OnMyMenu3" oContextMenuItem.Enabled = False Set oContextMenuItem1 = oMenuItems.Add oContextMenuItem1.MakeSubMenu oContextMenuItem1.Text = "MySub" Dim oSubMenu As GefContextMenu Set oSubMenu =
oContextMenuItem1.SubMenu Set oContextMenuItem =
oSubMenu.MenuItems.Add oContextMenuItem.SetActionToScript
"OnMyMenu2" oContextMenuItem.Text = "OnMyMenu2" oContextMenuItem.Checked = True Set oContextMenuItem =
oSubMenu.MenuItems.Add oContextMenuItem.SetActionToScript
"OnMyMenu3" oContextMenuItem.Text = "OnMyMenu3" oContextMenuItem.Enabled = False oMenuItems.MoveAfterMenuItem oContextMenuItem0,
oContextMenuItem1 End Sub |