cefsharp / Questions-and-Support

Use this repository to ask CefSharp specific questions
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

is posible create a submenu?? #65

Closed arcanisgk closed 3 years ago

arcanisgk commented 3 years ago

is posible create a submenu?

image

amaitland commented 3 years ago

If you are referring to modifying the built-in context menu displayed when right clicking within the browser then yes.

You can customise the menu in IContextMenuHandler.OnBeforeContextMenu.

See https://github.com/cefsharp/CefSharp/blob/cefsharp/85/CefSharp.WinForms.Example/Handlers/MenuHandler.cs for an example of adding new menu items.

Specifically you can call IMenuModel.AddSubMenu to add a sub menu noting that it returns IMenuModel itself` for which you can then add menuitems to.