Mega Code Archive

 
Categories / Delphi / Examples
 

Contextmenu

Use a TPopupMenu component for a Context Menu: then if, say, you want it to be accessible with a right- click on an image component, then in the MouseDown event handler for the TImage, all you need to say is: if (ssRight in Shift) then begin popupPos := DrawArea.ClientToScreen(Point(X, Y)); DAContextMenu.Popup(popupPos.x, popupPos.y); end; where popupPos is a variable of type TPoint- (note that the ClientToScreen call is important)...