Differences between .ContextMenu and .ContextMenuStrip(.ContextMenu 和 .ContextMenuStrip 的区别)
问题描述
Windows 窗体中的 .ContextMenu 和 .ContextMenuStrip 有什么区别?
What are the differences between .ContextMenu and .ContextMenuStrip in Windows Forms?
我已经知道 ContextMenu 是什么,但是 ContextMenuStrip 与 ContextMenu 有什么不同?
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 控件需要一个很好的想法并使它变得更好.它就像 ContextMenu 控件一样工作.您仍然可以通过以下方式将 ContextMenuStrip 控件附加到另一个用户控件更改该控件的 ContextMenuStrip 属性.然而,微软大大改进了您可以添加到ContextMenuStrip 续...
You might wonder why Microsoft has replaced a valuable and popular control with a newcomer. The
ContextMenuStripcontrol takes a good idea and makes it better. It works just like theContextMenucontrol. You still attach aContextMenuStripcontrol to another user control by changing that control’sContextMenuStripproperty. However, Microsoft has substantially improved the features you can add to aContextMenuStripcont...
查看 MSDN 上的示例:
Look at the examples at MSDN:
http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx
ContextMenuStrip 替换 ContextMenu.您可以关联一个ContextMenuStrip 带有任何控件,并单击鼠标右键自动显示快捷菜单.你可以展示一个ContextMenuStrip 以编程方式使用 Show 方法.ContextMenuStrip 支持可取消的 Opening 和 Closing 事件处理动态填充和多次点击场景.ContextMenuStrip 支持图片、菜单项检查状态、文本、访问键、快捷键和级联菜单.
ContextMenuStripreplacesContextMenu. You can associate aContextMenuStripwith any control, and a right mouse click automatically displays the shortcut menu. You can show aContextMenuStripprogrammatically by using the Show method.ContextMenuStripsupports cancelable Opening and Closing events to handle dynamic population and multiple-click scenarios.ContextMenuStripsupports 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
如果一个 ContextMenu 也已分配给控件,则ContextMenu 优先于 ContextMenuStrip.
If a
ContextMenuhas also been assigned to the control, theContextMenutakes precedence over theContextMenuStrip.
这篇关于.ContextMenu 和 .ContextMenuStrip 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:.ContextMenu 和 .ContextMenuStrip 的区别
基础教程推荐
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
