Using popup menus with picture buttons


It is possible to display a popup menu on the picture at the exact point where the user clicked. The program must contain a Click() event handler for the picture button. When the event handler is called the MouseX and MouseY properties are set to the location of the mouse click that triggered the event. The TrackPopup() menu method is then used to display the menu. The menu must have previously been created by the Menu Editor within the Forms designer. The following event handler could be used to display the menu Popup1 at the location of the last left mouse click:

-DEFEVENT Form1.picControl1.Click()
   .popup1.TrackPopup(..MouseX + ..Left, ..MouseY + ..Top)
 END EVENT