赞
踩
//先实现 IContextMenuHandler 接口
internal class MenuHandler : IContextMenuHandler
{
public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
{
//清除上下文菜单
model.Clear();
//throw new NotImplementedException();
}
public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
{
// throw new NotImplementedException();
return false;
}
public void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame)
{
// throw new NotImplementedException();
}
public bool RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
{
return false;
// throw new NotImplementedException();
}
}
browser.MenuHandler = new MenuHandler();
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。