What are the differences between .ContextMenu
and .ContextMenuStrip
in Windows Forms?
I already know what a ContextMenu
is, but how is ContextMenuStrip
different from ContextMenu
?
http://www.informit.com/articles/article.aspx?p=606224&seqNum=2
You might wonder why Microsoft has replaced a valuable and popular control with a newcomer. The
ContextMenuStrip
control takes a good idea and makes it better. It works just like theContextMenu
control. You still attach aContextMenuStrip
control to another user control by changing that control’sContextMenuStrip
property. However, Microsoft has substantially improved the features you can add to aContextMenuStrip
cont...
Look at the examples at MSDN:
http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx
ContextMenuStrip
replacesContextMenu
. You can associate aContextMenuStrip
with any control, and a right mouse click automatically displays the shortcut menu. You can show aContextMenuStrip
programmatically by using the Show method.ContextMenuStrip
supports cancelable Opening and Closing events to handle dynamic population and multiple-click scenarios.ContextMenuStrip
supports images, menu-item check state, text, access keys, shortcuts, and cascading menus.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.contextmenustrip.aspx
If a
ContextMenu
has also been assigned to the control, theContextMenu
takes precedence over theContextMenuStrip
.