Name
ContextMenu
Synopsis
Derived from Menu
, this represents a pop-up menu.
Extending the base functionality, you can Show()
the menu at a particular System.Drawing.Point
, and
you can set the owner Control
, which you can
retrieve through the SourceControl
property.
public class ContextMenu : Menu { // Public Constructors public ContextMenu(); public ContextMenu(MenuItem[ ] menuItems); // Public Instance Properties public virtual RightToLeft RightToLeft{set; get; } public Control SourceControl{get; } // Public Instance Methods public void Show(Control control, System.Drawing.Point pos); // Protected Instance Methods protected internal virtual void OnPopup(EventArgs e); // Events public event EventHandler Popup; }
Hierarchy
System.Object
→ System.MarshalByRefObject → System.ComponentModel.Component(System.ComponentModel.IComponen,
System.IDisposable)
→ Menu → ContextMenu
Returned By
Control.ContextMenu
, Menu.GetContextMenu()
, NotifyIcon.ContextMenu
Passed To
Control.ContextMenu
,
NotifyIcon.ContextMenu
Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.