Programmatically remove a command from a context menu?

742
2
Jump to solution
06-28-2012 03:21 PM
SuiHuang
Occasional Contributor II
Hi Everybody:

    I know that I can use ICommandBar.Add(contextMenuUID, ref position) to add a command to a context menu of ArcMap. However, there is no "remove" method in ICommandBar interface. Is there any way to programmatically remove an added command in some state of the ArcObjects extension?
    Thank you!
0 Kudos
1 Solution

Accepted Solutions
NeilClemmons
Regular Contributor III
Use ICommandBar.Find to get a reference to the command item then call ICommandItem.Delete.

View solution in original post

0 Kudos
2 Replies
NeilClemmons
Regular Contributor III
Use ICommandBar.Find to get a reference to the command item then call ICommandItem.Delete.
0 Kudos
SuiHuang
Occasional Contributor II
Use ICommandBar.Find to get a reference to the command item then call ICommandItem.Delete.


Thank you Neil!
0 Kudos