SetMenu error, menuItems are undefined.... #188

Closed
opened 2026-01-29 16:33:10 +00:00 by claunia · 1 comment
Owner

Originally created by @nvrnight on GitHub (Jun 25, 2018).

Originally assigned to: @GregorBiswanger on GitHub.

Getting an error trying to set the menu items. menuItems is undefined in browserWindows.js when executing.

window.SetMenu(new[] {
new MenuItem()
{
Role = MenuRole.reload
}
});

Originally created by @nvrnight on GitHub (Jun 25, 2018). Originally assigned to: @GregorBiswanger on GitHub. Getting an error trying to set the menu items. menuItems is undefined in browserWindows.js when executing. window.SetMenu(new[] { new MenuItem() { Role = MenuRole.reload } });
claunia added the question label 2026-01-29 16:33:10 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (Sep 25, 2018):

Hello @nvrnight
Use Electron.Menu.SetApplicationMenu.

See on our example:
https://github.com/ElectronNET/electron.net-api-demos/blob/master/ElectronNET-API-Demos/Controllers/MenusController.cs

Best,
Gregor

@GregorBiswanger commented on GitHub (Sep 25, 2018): Hello @nvrnight Use **Electron.Menu.SetApplicationMenu**. See on our example: https://github.com/ElectronNET/electron.net-api-demos/blob/master/ElectronNET-API-Demos/Controllers/MenusController.cs Best, Gregor
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#188