EnableMenuItems Does not Fire on Modal Windows?

I’m on a Mac (10.14.6) using 2019R1.1

For a MovableModal window the EnableMenuItems event on the Window does not seem to be firing when I use Window.ShowModal

Am I missing something?

Is that expected? I think it may be…

I THINK I vaguely remember running into this in the past at some point, but don’t recall exactly how I worked around it…

Is there a way to get the event to fire?

In the past I think i just hid the main window and used Show instead of ShowModal… But that won’t work here as the other window has info that is useful to refer to while working in the modal window.

There is not enough real-estate top redesign the UI to use a single window

  • which is why I used a movable modal window and not a sheet.

This will also need to work on Windows but right now I am just worried about the Mac.

Besides just enabling and disabling menuItems, I also change menuItem text in the event to make it more context sensitive.

So is there a workaround for this?

I suppose I could subclass MenuItem and store a reference to the window in the tag and have it do it itself in it’s Enable event based on the state of the window (and I guess it should be a Weak Ref for the window)… But there has to be a better way to deal with menus for Modal Windows!


That is what i did and it works … I was going to report this but when I tried the same code in the newest IDE I have access to, EnableMenuItems WAS called in the modal Windows so they fixed this sometime after 2019r1.1