0

C# Blazor with Electron.NET Tray icon opens tray menu regardless of if it's right or left click.

How do I disable opening the menu when it's a normal (left) click and make it just show the app instead?

This is what I want to happen when the tray is left clicked:

Electron.WindowManager.BrowserWindows.First().Hide();

Instead, it shows a menu like this: screenshot

BillyBoy
  • 11
  • 3
  • As per sources (https://github.com/ElectronNET/Electron.NET/blob/master/ElectronNET.API/Tray.cs), there are `click` event for tray icons, which may be handled as you want. Did you tried this? – Serg Jan 17 '22 at 17:40
  • Electron.Tray.OnClick += (TrayClickEventArgs, Rectangle) => { Electron.App.Exit(0); }; Electron.Tray.On("click", () => { Electron.App.Exit(0); }); This is what I've tried so far: nothing happens. – BillyBoy Jan 17 '22 at 17:55

0 Answers0