在.NET中,有哪些.ContextMenu和.ContextMenuStrip之间的区别? [英] In .NET, what are the differences between .ContextMenu and .ContextMenuStrip?
问题描述
在.NET中,什么是之间的 .ContextMenu
的区别和 .ContextMenuStrip
?
In .NET, what are the differences between .ContextMenu
and .ContextMenuStrip
?
我已经知道什么是文本菜单
是的,但如何的ContextMenuStrip
从不同的文本菜单
?
I already know what a ContextMenu
is, but how is ContextMenuStrip
different from ContextMenu
?
推荐答案
<一个href="http://www.informit.com/articles/article.aspx?p=606224&seqNum=2">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:
<一个href="http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx">http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx
的ContextMenuStrip
替换文本菜单
。您可以关联一个
的ContextMenuStrip
与任何控制,并单击鼠标右键
自动显示快捷菜单。您可以显示一个
的ContextMenuStrip
编程方式通过使用Show方法。
的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.
<一个href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.contextmenustrip.aspx">http://msdn.microsoft.com/en-us/library/system.windows.forms.control.contextmenustrip.aspx
如果一个文本菜单
也被分配到控制中,
文本菜单
花费precedence在的ContextMenuStrip
。
If a
ContextMenu
has also been assigned to the control, theContextMenu
takes precedence over theContextMenuStrip
.
这篇关于在.NET中,有哪些.ContextMenu和.ContextMenuStrip之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!