Working with Context Menus in CefSharp

Published on November 29, 2017
WorkingWithContextMenusHeader.jpg

This tutorial demonstrates how to build your own context menu in .NET application by means of CefSharp.

Lets try to search the selected text via some search engine. Usually, we need to select the text, copy it, open the search engine, paste text and press ‘Search’.

Using the context menus this can be done much easier.

So, the MainWindow.xaml just contains the ChromiumWebBrowser component:

And here is the MainWindow.xaml.cs with the context menu handler implementation:

The context menu appears on the right click on the selected text:

image-title-here

And the new window with the search results is opened upon a click:

image-title-here

Categories: Articles

Tags: Chromium