Spread Windows Forms 6.0 Product Documentation
ContextMenu Property
See Also  Example Support Options
FarPoint.Win Assembly > FarPoint.Win Namespace > SuperEditBase Class : ContextMenu Property


Glossary Item Box

Gets or sets the context menu to display for the control.

Syntax

Visual Basic (Declaration) 
Public Overrides Property ContextMenu As ContextMenu
Visual Basic (Usage)Copy Code
Dim instance As SuperEditBase
Dim value As ContextMenu
 
instance.ContextMenu = value
 
value = instance.ContextMenu
C# 
public override ContextMenu ContextMenu {get; set;}

Property Value

ContextMenu object containing the context menu for the edit control

Remarks

The context menu is the pop-up menu displayed when the user right-clicks the edit control. If you want to provide a basic pop-up menu with edit commands, set the AutoMenu property to true. If you want to provide a custom pop-up menu, use this property.

Example

C#Copy Code
private System.Windows.Forms.MenuItem mitem1;
private System.Windows.Forms.MenuItem mitem2;
private System.Windows.Forms.MenuItem mitem3;
private System.Windows.Forms.ContextMenu cmenu;
this.mitem1 = new System.Windows.Forms.MenuItem("Change");
this.mitem2 = new System.Windows.Forms.MenuItem("Edit");
this.mitem3 = new System.Windows.Forms.MenuItem("Delete");
this.cmenu = new System.Windows.Forms.ContextMenu();
this.cmenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[3]{mitem1,mitem2,mitem3});
control.AutoMenu = true;
control.ContextMenu = cmenu;
Visual BasicCopy Code
Dim mitem1 As New MenuItem("Change")
Dim mitem2 As New MenuItem("Edit")
Dim mitem3 As New MenuItem("Delete")
Dim cmenu As New ContextMenu()
cmenu.MenuItems.Add(mitem1)
cmenu.MenuItems.Add(mitem2)
cmenu.MenuItems.Add(mitem3)
control.AutoMenu = True
control.ContextMenu = cmenu

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.