.ContextMenu和.ContextMenuStrip之间的差异 [英] Differences between .ContextMenu and .ContextMenuStrip
问题描述
什么是在Windows窗体 .ContextMenu
和 .ContextMenuStrip
之间的区别是什么?
What are the differences between .ContextMenu
and .ContextMenuStrip
in Windows Forms?
我已经知道什么是文本菜单
是的,但如何从<$ 的ContextMenuStrip
不同C $ C>文本菜单
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
您可能想知道为什么微软已经换成了新人一个有价值的和流行的
控制。在的ContextMenuStrip
控制需要一个良好的
想法,令它变得更好。它的工作原理就像文本菜单
控制。
你还附上的ContextMenuStrip
控制由
更改该控件的的ContextMenuStrip
属性的其他用户控制。然而,微软
已经大大提高您可以添加到
的ContextMenuStrip
续...
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...
看例子在MSDN:
的 http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx
的ContextMenuStrip
替换文本菜单
。您可以在
的ContextMenuStrip
与任何控件关联,并单击鼠标右键
自动显示快捷菜单。您可以通过使用Show方法显示出
的ContextMenuStrip
编程。
的ContextMenuStrip
支持取消开幕式和闭幕式活动,以
处理动态人口和多个点击场景。
的ContextMenuStrip
支持图像,菜单项检查状态,文字,访问
键,快捷方式和级联菜单。
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
如果一个文本菜单
也被分配给控制中,
文本菜单
优先于的ContextMenuStrip
。
If a
ContextMenu
has also been assigned to the control, theContextMenu
takes precedence over theContextMenuStrip
.
这篇关于.ContextMenu和.ContextMenuStrip之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!