Post by bobowk on May 12, 2017 18:16:18 GMT 10
Hey guys, I was just wondering how to add a custom contextmenustrip in CEFSharp. This doesn't work: web.ContextMenuStrip = webcontext;
Nathan Lecompte EDIT: using CefSharp;
using System;
using System.Windows;
public class menu : CefSharp.IContextMenuHandler
{
public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
{
Console.WriteLine("Context menu opened !");
if (model.Count > 0)
{
model.AddSeparator();
}
model.AddItem((CefMenuCommand)26501, "Show DevTools");
}
public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
{
if (commandId == (CefMenuCommand)26501)
{
browser.GetHost().ShowDevTools();
return true;
}
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;
}
}
I got the code but now how do I check if text or a link is selected so I can hide some items
|
|
Post by bobowk on May 15, 2017 14:22:18 GMT 10
bump
|
|
Post by bobowk on Jun 12, 2017 21:26:47 GMT 10
I REALLY NEED TO GET THIS DONE
|
|
Post by Imformas on Jun 13, 2017 19:27:35 GMT 10
Then use google bro, you're not gonna get an awnser from this forums no more aha, its more deader than the nails in my wall
Programming language'sCSharpC++CObjective-CVBProject'sSharpMediaSharpEditYoutifygithub.com/Stephen-Fox-0
|
|