How do I hide the CefSharp.WinForms.ChromiumWebBrowser right click context menu?

前端 未结 5 1459
-上瘾入骨i
-上瘾入骨i 2021-02-07 01:01

I\'m using CefSharp.WinForms.ChromiumWebBrowser v45 in my project. When I right click into the web browser, the default context menu will show up:

5条回答
  •  野性不改
    2021-02-07 01:49

    If you implement IContextMenuHandler you can control the ContextMenu. The two links below demo what's required (and some other useful features).

    https://github.com/cefsharp/CefSharp/blob/935d3900ba2147f4786386596b62339087ff61b0/CefSharp.WinForms.Example/Handlers/MenuHandler.cs#L15

    https://github.com/cefsharp/CefSharp/blob/c18f951a97a515df112d67775c767d4222f88c23/CefSharp.WinForms.Example/BrowserTabUserControl.cs#L31

    In general the CefSharp.WinForms.Example project demos quite a few features, check it out if you require other features.

提交回复
热议问题