I already tried but that doesn’t work.
Another error shows up saying ; Parameter “index” expects type integer, but this is class DesktopMenuItem.
‘mnu1’ is a menu in the menubar mnuFrmMixMaster
In XOJO 2021r1.1 There are 2 possibilities ;
MenuItem.Remove(Index As Integer) → Removes the MenuItem specified by its index. MenuItem.Remove(Item As MenuItem) → removes the menu specified by reference.
For the code in bold I am looking for a replacement in XOJO 2022r1.
I found a solution ;
As it are 2 menus that are dynamically created when running, they are placed at the end of the menubar (two last indexes).
So I do twice a 'menuBar.RemoveMenuAt(menuBar.LastRowIndex)
This does exactly what i wanted.
However I will later on search for a better solution.
Or perhaps XOJO will create a Remove menu by reference as existed before API2.