DesktopMenuItem.Icon does not turn gray if not enabled

When I add an icon to a menu in the menu bar, it does not turn gray when the menu is not enabled.

When I assign a gray icon in the “MenuBarSelected” event, the icon is only displayed in gray when the menu is called up for the second time. I assume that when “Auto Enabled” is turned on, Enabled is only set after the “MenuBarSelected” event.

Is there a solution? I want to use SF-Symbols for macOS 26 Menus.

This works, but you’re right, auto enabled must be turned off.

dim m as NSMenuItemMBS = NSMenuItemMBS.MenuItem(FileTest1)
m.image = NSImageMBS.imageWithSystemSymbolName("document")
FileTest1.Enabled = False

m = NSMenuItemMBS.MenuItem(FileTest2)
m.image = NSImageMBS.imageWithSystemSymbolName("document")
FileTest2.Enabled = True

Yes, the icon drawing disabled correctly is a feature of using SFSymbols the way they were intended :slight_smile:

I’ve tried a lot of things here, but haven’t found a solution.

Where can I find an example?

When using SFSymbols as a system vector, you don’t need to switch the Picture in the MenuBarSelected event. The easiest approach is as Jared demonstrated above with MBS plugins.

You might be able to pull off using NSImage templates with declares, but I don’t know if I’ve seen any readily available blocks of code for that.

As far as switching Pictures in that event, you should create a small sample project and file an issues ticket for that. I haven’t ever tried it (I’m not an icons in menus guy), but it sounds like a framework bug.

Thanks, Tim. I think I’ve found the solution.
It works as Jared described. Even with Auto Enabled.

1 Like

Excellent article, by the way!
Really showing a bad direction Apple is going to.