TrackPopup

[method icon] TrackPopup(iLeft, iTop)

Pops up the menu at the specified coordinates

iLeft Integer Horizontal position of menu
iTop Integer Vertical position of menu

Applies to: Menu


>

TrackPopup

Int1      Specifies the x coordinate of the popup menu
Int2      Specifies the y coordinate of the popup menu

This method is used to display a popup menu at the specified coordinates. Popup menus are created separately via the Menu editor in the KCML Forms Designer. This method is only useful when called by the Click() Picture control event handler or the LeftClick() and RightClick() Grid control or Tree control event handlers as the mouse pointer coordinates at the time of the click automatically passed into these handlers.

The mouse pointer co-ordinates are returned by the MouseFormX and MouseFormY properties. These can be used with TrackPopup() to place the menu at the exact location of the click. For example, the following grid control event handler displays the menu Popup1 at the location of the last mouse click:

-DEFEVENT Form1.GridControl1.LeftClick()
.menu1.TrackPopup(..MouseFormX, ..MouseFormY)
END EVENT

Note that when working with the Grid control, the LeftClick() and RightClick() event handlers can only be used if the LeftAction and RightAction properties are set accordingly.

See also

Menu methods, properties and events.