wpf - CefSharp新版IContextMenuHandler
问题描述
如何隐藏 CefSharp.WinForms.ChromiumWebBrowser 右键单击上下文菜单?
public class CustomMenuHandler : CefSharp.IContextMenuHandler
{
public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
{
model.Clear();
}
public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
{
return false;
}
public void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame)
{
}
public bool RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
{
return false;
}
}
以前我使用上面帖子中的代码来禁用 CefSharp 中的上下文菜单。随着最新的更新,CefSharp.IContextMenuHandler 不再存在
我怎样才能恢复这个功能?
解决方案
推荐阅读
- matlab - Barchart Matlab-确定平均值和创建带有误差线的条形图的问题
- mysql - 找不到将mysql连接到phpmyadmin数据库的方法
- c++ - 重载运算符“=”用于具有共享ptr c ++的向量
- python - 在给定已打开文件的情况下加载 Keras 模型
- laravel - Laravel API:如何在表中制作默认图像而不是 NULL
- visual-studio-code - 如何构造加入终端的“When”条件?
- mysql - 从多个表中选择并与 COUNT 关联
- javascript - 使用Javascript在输入元素中输入文本
- google-cloud-platform - 在 Bigquery 中执行存储过程时捕获错误消息和执行详细信息
- javascript - 从 JavaScript 运行 python 文件