天道酬勤,学无止境

自定义右键菜单

CefSharp For WPF自定义右键菜单栏

初始化public MainWindow() { InitializeComponent(); //右键菜单栏 MenuHandler.mainWindow = this; webBrowser.MenuHandler = new MenuHandler(); }MenuHandler.cspublic class MenuHandler : IContextMenuHandler { public static Window mainWindow { get; set; } void IContextMenuHandler.OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model) { } bool IContextMenuHandler.OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags) { return

2021-05-18 14:42:09    分类:博客    自定义右键菜单    WPF