From f33367316e22e45071b1ed636303a619faa5fe87 Mon Sep 17 00:00:00 2001 From: matty <10895809+murrty@users.noreply.github.com> Date: Tue, 10 Oct 2023 07:16:56 -0500 Subject: [PATCH 1/2] add new change id for visibility change --- System/Windows/Forms/MenuItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/System/Windows/Forms/MenuItem.cs b/System/Windows/Forms/MenuItem.cs index 8cbc956..7496695 100644 --- a/System/Windows/Forms/MenuItem.cs +++ b/System/Windows/Forms/MenuItem.cs @@ -155,7 +155,7 @@ internal bool Visible if ((state & 0x10000) == 0 != value) { state = (value ? (state & -65537) : (state | 0x10000)); - ItemsChanged(1); + ItemsChanged(4); } } } From 6bd4b1a6dfa61fe0942c2a51391472a581c21c4b Mon Sep 17 00:00:00 2001 From: matty <10895809+murrty@users.noreply.github.com> Date: Tue, 10 Oct 2023 07:18:19 -0500 Subject: [PATCH 2/2] add new catch for the change id in the menu parent --- System/Windows/Forms/Menu.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/System/Windows/Forms/Menu.cs b/System/Windows/Forms/Menu.cs index d7db668..4b528c4 100644 --- a/System/Windows/Forms/Menu.cs +++ b/System/Windows/Forms/Menu.cs @@ -883,6 +883,14 @@ internal virtual void ItemsChanged(int change) { DestroyMenuItems(); } + else if ((uint)change == 4) + { + DestroyMenuItems(); + CreateMenuItems(); + foreach (MenuItem item in MenuItems) { + item.UpdateMenuItem(true); + } + } } private IntPtr MatchKeyToMenuItem(int startItem, char key, MenuItemKeyComparer comparer)