How to keep NSStatusItemMBS highlighted?

Hi! I’m using NSStatusItemMBS to open a window. How do I keep the StatusItem highlighted while my window is visible?

Any ideas, can it be done?

I had the same issue and managed a simple workaround. Inside the NSStatusItemMBS Action event handler (accessible by creating a new class like MyStatusMenu with NSStatusItemMBS as its Super), you can pause the code to keep the highlight up while the rest of your UI is responsive:

If System.MouseDown Then Me.StayHighlighted = True While Me.StayHighlighted = True App.DoEvents 10 // uses ~4% CPU while menu is open Wend End If

Now in your custom window Close event, just set MyStatusMenu.StayHighlighted = False. Hope that helps!