I am trying to Programmically enable or disable Contextual MenuItem Such as
Created under the ConstructContextualMenu Event.
base.Append(New MenuItem(“Crop”))
i would later in the app Disable this or Re-Enable this.
I have tried MenuItem.Item(0).Enabled = False. But this does not work, it gives a class instance error.
You create a menu item in ConstructContextualMenu event which is not existing anymore after the event ends. You cannot manipulate it from somewhere else. This will work:
Dim item As New MenuItem("Crop")
item.Enabled = False
base.Append(item)