GefContextMenu.Parent (read-only property)

Gets the GefObject that is the context of this menu.
Syntax: Set GefObject = object.Parent
Description: The Parent property will return the GefObject that was clicked on with the mouse.

Example:

Sub OnPreContextMenu(oContextMenu As GefContextMenu)
  Dim xPos As Long
  Dim yPos As Long
  xPos = oContextMenu.Parent.Left
  yPos = oContextMenu.Parent.Top - oContextMenu.Parent.Height
  'Make the menu appear below the object instead of where the mouse was clicked
  oContextMenu.Left = xPos
  oContextMenu.Top = yPos
    
End Sub