t e m p o r a l 
 d o o r w a y 

Putting A Popup On The Standard HTML Control

 

The standard HTML control has no facility for a popup menu. So you need to put the following in the OnMouseDown handler for the HTML (assuming it's called HTML1 and your popup is PopupMenu1):

TPoint FormPoint,ScreenPoint;

FormPoint.x = X;
FormPoint.y = Y;

ScreenPoint = HTML1->ClientToScreen(FormPoint);

if (Button == mbRight) PopupMenu1->Popup(ScreenPoint.x,ScreenPoint.y);

Note the special conversion (ClientToScreen) needed to map the coordinates so the popup appears in the right place.

Copyright © 2004 by Mark Cashman (unless otherwise indicated), All Rights Reserved