I use TTMSFNCWebBrowser to show web pages. But if the user right clic, then contual menu appears, and then he can review the code, etc.
How can I forbid that ?
Regards
I use TTMSFNCWebBrowser to show web pages. But if the user right clic, then contual menu appears, and then he can review the code, etc.
How can I forbid that ?
Regards
With the EnableContextMenu property set to False in the OnInitialized event
Runs fine.
Thanks a lot
And how to disable the context menu with TTMSFNCMaps? If I put "TMSFNCMaps1.EnableContextMenu := False" in the OnMapInitialized event of the demo "PolyElements, Markers and Popups", I still get the context menu.
If I change the procedure "constructor TCoreWebView2ContextMenuRequestedEventHandler.Create(AWebBrowser: TTMSFNCWinWebBrowser);" like this, it works for me:
if (Result = S_OK) and FWebBrowser.GetEnableContextMenu then
begin
Result := FWebBrowser.GetContextMenuItems(nil, ic, FWebBrowser.ContextMenuList);
In the next release you will be able to use the EnableContextMenu on FormCreate:
procedure TForm3.FormCreate(Sender: TObject);
begin
TMSFNCMaps1.EnableContextMenu := False;
end;
For the moment it is not yet possible to do this the normal way, so we advise to use the following:
type
TTMSFNCMapsOpen = class(TTMSFNCMaps);
procedure TForm3.FormCreate(Sender: TObject);
begin
TTMSFNCMapsOpen(TMSFNCMaps1).Settings.EnableContextMenu := False;
end;
Thank you for the fast response. The alternative solution is working for me.