Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The ShowContextMenu method displays a context menu anywhere on the surface of the control. Start by passing the mouse coordinates relative to the top left corner of the control. So, "0,0" places the context menu in the top left corner. The Point parameter can use either the comma or @FM for the delimiter.

The Menu MenuStructure parameter describes the menu to appear. Each field represents on menu item. Each item has three values. The first value is any unique key or value you want to use to refer to the item later. The second value is the text to appear. For example, you can have an item whose key is "1" and text is "Copy". Or, the key could be "COPY" instead of "1". Whatever you pass is fine, as it will simply be forwarded onto the the OnContextMenuClick event so you know exactly what was clicked. The third value is a flag indicating whether or not the menu item is enabled. This is useful for showing all available options but keeping certain ones enabled only when necessary. You can omit the third value, in which case the menu item will be enabled.

...