mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
How to add menu to an app? #315
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @win32nipuh on GitHub (May 15, 2019).
Originally assigned to: @GregorBiswanger on GitHub.
How to add yet another menu to the app?
For example: the default menu is
File, Edit, View, Window, Help
I'd like to add my menu item + subitems
File, Edit, View, Tools (Options, Customize), Window, Help
How to do it?
When I do as in example, sipmle :
var menu = new MenuItem[]
{
new MenuItem
{
Label = "Tools",
Click = async () =>
{
await Electron.Dialog.ShowMessageBoxAsync("Go-go Pockemon!");
}
}
};
Electron.Menu.SetApplicationMenu(menu);
it replaces entire application menu.