問題描述
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
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 上的示例:
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
支持圖片、菜單項檢查狀態、文本、訪問鍵、快捷鍵和級聯菜單.
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
如果一個 ContextMenu
也已分配給控件,則ContextMenu
優先于 ContextMenuStrip
.
If a
ContextMenu
has also been assigned to the control, theContextMenu
takes precedence over theContextMenuStrip
.
這篇關于.ContextMenu 和 .ContextMenuStrip 的區別的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!