I am constructing a contextual menu, so whenever a user right-click an object on a form, then a contextual menu is shown with the actions for that control.
I have constructed a contextual menu for the form itself.
I have two other controls on that form. In each ConstructContextualMenu handler I add menu items specifically for that control.
while right clicking the form, the contextual menu is correct. However when right clicking one of those controls, then on top are the menu items shown for that item, but under them, the menu items for the form.
I searched the Language reference but cannot find anything to start with a fresh contextual menu each time one of those controls is right clicked.
Can you tell me how to start with an empty contextual menu whenever the user right click a control?
Thank you very much for your help.