I'm trying to hide the context menu item associated with the ToolBar.
When I run the code containing
tool.SharedProps.Visible = false;
I hides not only the Menu Item but also the button in the ToolBar (I don't want this).
How can I achieve only hiden items on the Context Menu.
So you want a tool to be visible on a toolbar, but hidden from the "Add or Remove Buttons" list for it's toolbar? If that is the case, this is not possible. All tools visible on the toolbar must appear in this list. You can submit a feature request for a property on the tool which would hide it from the list.
I don't want to hide the entire context menu. I only want to hide an item from the context menu.
"Edit"
I'm not sure I fully understand your question. I think you are trying to hide the context menu which appears when you right-click on a toolbar. If this is the case, you can handle the UltraToolbarsManager.BeforeToolbarListDropdown event and set Cancel to True on the event args.