Closed
Description
🚨 The issue tracker is not for questions 🚨
How to hide browser window and put application in Tray mode on close button clicked?
I tried as it shown below;
browserWindow.OnClose += () => OnClose(browserWindow);
and OnClose action;
private static void OnClose(BrowserWindow browserWindow)
{
browserWindow.Hide();
var menu = new MenuItem[]
{
new MenuItem
{
Label = "Show",
Click = () =>
{
Electron.Tray.Destroy();
browserWindow.Show();
}
},
new MenuItem
{
Label = "Quit",
Click = () => Electron.App.Quit()
}
};
Electron.Tray.Show("favicon.ico", menu);
Electron.Tray.SetToolTip("Electron Demo in the tray.");
}