如何禁用右键菜单?
public CefWebBrowser browser = new CefWebBrowser();
在 CefWebBrowser 上右键F12,转到定义CefWebBrowser[从元数据]
#region 程序集 Xilium.CefGlue.WindowsForms.dll, v1.0.0.0 // 谷歌内核 #endregion using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using Xilium.CefGlue; namespace Xilium.CefGlue.WindowsForms { [ToolboxBitmap(typeof(CefWebBrowser))] public class CefWebBrowser : Control { public CefWebBrowser(); public string Address { get; } public CefBrowser Browser { get; } [DefaultValue("about:blank")] public string StartUrl { get; set; } public string Title { get; } public event EventHandler<AddressChangedEventArgs> AddressChanged; public event EventHandler BeforeClose; public event EventHandler<BeforePopupEventArgs> BeforePopup; public event EventHandler BrowserCreated; public event EventHandler<ConsoleMessageEventArgs> ConsoleMessage; public event EventHandler<LoadEndEventArgs> LoadEnd; public event EventHandler<LoadErrorEventArgs> LoadError; public event EventHandler<LoadingStateChangeEventArgs> LoadingStateChange; public event EventHandler<LoadStartEventArgs> LoadStarted; public event EventHandler<PluginCrashedEventArgs> PluginCrashed; public event EventHandler<RenderProcessTerminatedEventArgs> RenderProcessTerminated; public event EventHandler<StatusMessageEventArgs> StatusMessage; public event EventHandler<TitleChangedEventArgs> TitleChanged; public event EventHandler<TooltipEventArgs> Tooltip; protected override void Dispose(bool disposing); public void InvalidateSize(); protected internal virtual void OnAddressChanged(AddressChangedEventArgs e); protected internal virtual void OnBeforeClose(); protected internal virtual void OnBeforePopup(BeforePopupEventArgs e); protected internal virtual void OnBrowserAfterCreated(CefBrowser browser); protected internal virtual void OnConsoleMessage(ConsoleMessageEventArgs e); protected override void OnHandleCreated(EventArgs e); protected internal virtual void OnLoadEnd(LoadEndEventArgs e); protected internal virtual void OnLoadError(LoadErrorEventArgs e); protected internal virtual void OnLoadingStateChange(LoadingStateChangeEventArgs e); protected internal virtual void OnLoadStart(LoadStartEventArgs e); protected internal virtual void OnPluginCrashed(PluginCrashedEventArgs e); protected internal virtual void OnRenderProcessTerminated(RenderProcessTerminatedEventArgs e); protected override void OnResize(EventArgs e); protected internal virtual void OnStatusMessage(StatusMessageEventArgs e); protected internal virtual void OnTitleChanged(TitleChangedEventArgs e); protected internal virtual void OnTooltip(TooltipEventArgs e); } }
把某个方法重载下
大侠,某个方法是?
@板da凳: 早忘了,你看看呗,试下是哪个handler
CefContextMenuHandler?
具体的看源码呗,又不多
@日暮青色: https://www.cnblogs.com/chechen/p/6721462.html
如果按照你说的 这个貌似是,但具体应该写在哪里,能不能指点下?