Submenu not shown #490

Open
opened 2026-01-29 16:41:03 +00:00 by claunia · 0 comments
Owner

Originally created by @graylobo on GitHub (May 14, 2020).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version: 8.31.2
  • Target:

I'm trying to make 'One' menu, and 'Two' submenu.
my code is below

Task.Run(async () => { var options = new BrowserWindowOptions { Show = true }; Electron.Menu.SetApplicationMenu(new MenuItem[] { new MenuItem { Label = "One" ,Submenu = new MenuItem[] { new MenuItem {Label="Two" } } } }); await Electron.WindowManager.CreateWindowAsync(); });

It makes 'One' menu, but nothing happen when i click it.
20200514_183345
And this github demo also does not display submenu.
https://github.com/ElectronNET/electron.net-api-demos
Can i know what am I missing?

Originally created by @graylobo on GitHub (May 14, 2020). Originally assigned to: @GregorBiswanger on GitHub. <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: 8.31.2 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> <!-- What target are you building for? --> * **Target**: <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> I'm trying to make 'One' menu, and 'Two' submenu. my code is below ` Task.Run(async () => { var options = new BrowserWindowOptions { Show = true }; Electron.Menu.SetApplicationMenu(new MenuItem[] { new MenuItem { Label = "One" ,Submenu = new MenuItem[] { new MenuItem {Label="Two" } } } }); await Electron.WindowManager.CreateWindowAsync(); }); ` It makes 'One' menu, but nothing happen when i click it. ![20200514_183345](https://user-images.githubusercontent.com/37823841/81919252-90bb6780-9612-11ea-9f92-2be8dcb1b5d3.png) And this github demo also does not display submenu. https://github.com/ElectronNET/electron.net-api-demos Can i know what am I missing?
claunia added the question label 2026-01-29 16:41:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#490