I have used the following code to add a Close All But This menuitem for the tabs.
EventHandler
handler = delegate(object s, EventArgs args)
{
CloseAllButThis(e.Tab.Form);
};
e.ContextMenu.MenuItems.Add(Resources.
Resource.CloseAllButThis, handler);
The code works perfect, but the MenuItem looks horrible! Is there any way to add a good looking MenuItem to the popup menu? Now it has a different font, highlightning get stucked after the mouse moves to another menu item and so on.
Instead of calling the Add method of the MenuItems collection, try to instead create an Infragistics.Win.IGControls.IGMenuItem instance. This is our derived MenuItem type which has a different appearance from the normal menu item. Create an instance of that and add that to the MenuItems collection.