.ContextMenu和.ContextMenuStrip之间的差异 [英] Differences between .ContextMenu and .ContextMenuStrip

查看:348
本文介绍了.ContextMenu和.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 the ContextMenu control. You still attach a ContextMenuStrip control to another user control by changing that control’s ContextMenuStrip property. However, Microsoft has substantially improved the features you can add to a ContextMenuStrip cont...

看例子在MSDN:

http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx

的ContextMenuStrip 替换文本菜单。您可以在
的ContextMenuStrip 与任何控件关联,并单击鼠标右键
自动显示快捷菜单。您可以通过使用Show方法显示出
的ContextMenuStrip 编程。
的ContextMenuStrip 支持取消开幕式和闭幕式活动,以
处理动态人口和多个点击场景。
的ContextMenuStrip 支持图像,菜单项检查状态,文字,访问
键,快捷方式和级联菜单。

ContextMenuStrip replaces ContextMenu. You can associate a ContextMenuStrip with any control, and a right mouse click automatically displays the shortcut menu. You can show a ContextMenuStrip 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, the ContextMenu takes precedence over the ContextMenuStrip.

这篇关于.ContextMenu和.ContextMenuStrip之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆