Normally you would maintain the flags of the MenuItem. The NewMenu array is only needed for the initial creation of the menu strip. After that you can throw it away.
Attached is a full example.
One challenge is to find the address of the item you want to manipulate in the menu strip. The example uses ItemAddress with a fixed menu number. In a more complex example I would rather write a function which traverses the menu strip and finds the item with the corresponding code in the user data field. This way I am independent of menu changes in later versions.
|