EnableMenuItems Called in 2019r1.1 for modal Windows?

I don’t know if something is still munged in my project or this is a bug now fixed in new IDE’s OR both!

I could have sworn when I tested in a simple project EnableMenuItems fired on a modalWindow in 2019r1.1…

But it is definitely not being called in a modal window in my actually project…

I think I posted about the previously but once I found out my project was munged, I though that might be just a manifestation of that, so after (I think) recovering my work, I pulled out the workaround I put for that and went back to using the event…

But it’s not firing again. I tried my project in 2018r3, but EnableMenuItems did not fire there for that modal window either … But it does in 2020R1 … but I can’t use that because I need backwards compatibility…

So I don’t know if:

  1. there was long standing bug that prevented EnableMenuItem from firing for a ModalWindow that was fix after 21019r1.1 - I could not find anything in feedback or the release notes… can anybody tell me if that is the case?

  2. my project is still subtly munged but 2020r1 can deal with the munging in a way older IDE’s can not…

  3. somehow there is something in my code that is causing this in 2019r1.1 and earlier but not 2020r1.

  • Karen

I still don’t how WHY EnableMenuItems is not firing on that modal widow, but I found a workaround (which in retrospect should have been obvious)…

Whenever there is a state change that needs to be reflected in the MenuItem state (be it the text, check or enabled), instead of waiting for the EnableMenuItems event, I immediately update it in the method that changes the state.

To control if the item is enabled or not I set the value of the AutoEnable property.

Never thought of doing that before because I always relied on the EnableMenuItems events…

I think I like doing it this way as it encapsulates everything that needs to happen with the change in state the MenuItem is associated with.

Maybe others have been doing this all along, but in case like myself it never occurred to you, i figured I would share this.

-Karen