|
|
#1 |
|
Main Developer
Join Date: May 2006
Posts: 913
|
Question:
How to display a custom popup menu in TEmbeddedWB? Answer: a) In the Object Inspector, - assign a TPopupMenu to the EmbeddedWB - Set DisabledPopupMenus := [rcmAll] b) - Assign a OnShowContextMenu handler in the Object Inspector - Return S_OK (to disable all context menus) - Popup a PopupMenu / the assigned TPopupMenu Example: Only display a custom Popup menu for CONTEXT_MENU_IMAGE Code:
procedure TForm1.EmbeddedWB1ShowContextMenu(Sender: TCustomEmbeddedWB;
const dwID: Cardinal; const ppt: PPoint; const CommandTarget: IInterface;
const Context: IDispatch; var Result: HRESULT);
begin
if dwID = CONTEXT_MENU_IMAGE then
begin
Sender.PopupMenu.Popup(ppt.X, ppt.Y);
Result := S_OK;
end;
end;
|
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Jun 2010
Posts: 4
|
You ask the question and you also give the answer very strange but That's very good information for sharing. This post is really nice. Now I know how to display custom pop-up menu in a embedded window.
|
|
|
|
![]() |
| Tags |
| contextmenu |
| Thread Tools | |
| Display Modes | |
|
|