What is the difference between .ContextMenu and .ContextMenuStrip in Windows Forms?
.ContextMenu
.ContextMenuStrip
I already know what ContextMenu , but how is ContextMenuStrip different from ContextMenu ?
ContextMenu
ContextMenuStrip
http://www.informit.com/articles/article.aspx?p=606224&seqNum=2
You may wonder why Microsoft has replaced the valuable and popular control with a newbie. The ContextMenuStrip control takes a good idea and makes it better. It works the same as the ContextMenu control. You still attach the ContextMenuStrip control to another user control by changing which controls the ContextMenuStrip property. However, Microsoft has greatly improved the features you can add to ContextMenuStrip cont ...
Check out the examples on MSDN:
http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx
ContextMenuStrip replaces ContextMenu . You can associate ContextMenuStrip with any control and by right-clicking automatically displays the context menu. You can show ContextMenuStrip programmatically using the Show method. ContextMenuStrip supports canceled open and close events for handling dynamic populations and multiple click scripts. ContextMenuStrip supports images, menu item verification status, text, access keys, shortcuts, and cascading menus.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.contextmenustrip.aspx
If a ContextMenu also been assigned to the control, ContextMenu takes precedence over ContextMenuStrip .
From doc
ContextMenuStrip replaces ContextMenu.
According to MSDN , ContextMenuStrip replaces the ContextMenu class:
Although ContextMenuStrip replaces and adds the functionality of ContextMenu for managing previous versions, ContextMenu is retained for both backward compatibility and future use if you choose.
Source: MSDN - ContextMenu
Edit: why -1?
contextMenu - msdn and also contextMenuStrip - msdn
contextMenu - represents a context menu. Although ContextMenuStrip replaces and adds features to previous versions of ContextMenu controls, ContextMenu is retained for both backward compatibility and future use if you choose.
ContextMenuStrip replaces and adds functionality to the previous version of ContextMenu control
If you click on ContextMenu , you will notice that ContextMenuStrip replaces it, but ContextMenu left for compatibility purposes.