[TTMSFNCWebBrowser]} How to disable capability to show contextual menu in webbrowser

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 ?


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
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);
  TMSFNCMaps1.EnableContextMenu := False;

For the moment it is not yet possible to do this the normal way, so we advise to use the following:

  TTMSFNCMapsOpen = class(TTMSFNCMaps);

procedure TForm3.FormCreate(Sender: TObject);
  TTMSFNCMapsOpen(TMSFNCMaps1).Settings.EnableContextMenu := False;

Thank you for the fast response. The alternative solution is working for me.