ShellListViewBackgroundContextMenu Property |
Gets or sets the ContextMenuStrip that is displayed if no item of the
listview is under the cursor if the user clicks the right mouse button.
If this value is null, no ContextMenu is shown.
Namespace:
Jam.Shell
Assembly:
ShellBrowser.Winforms (in ShellBrowser.Winforms.dll) Version: 6.3.1
Syntax public override ContextMenuStrip BackgroundContextMenu { get; set; }
Public Overrides Property BackgroundContextMenu As ContextMenuStrip
Get
Set
public:
virtual property ContextMenuStrip^ BackgroundContextMenu {
ContextMenuStrip^ get () override;
void set (ContextMenuStrip^ value) override;
}
abstract BackgroundContextMenu : ContextMenuStrip with get, set
override BackgroundContextMenu : ContextMenuStrip with get, set
Property Value
Type:
ContextMenuStripRemarks Examples
The following example uses
BackgroundContextMenu as base class for a custom background context menu and assigns it in the Load event of a form.
class MyBackgroundContextMenu : BackgroundContextMenu
{
protected override void SetupMenuItems()
{
base.SetupMenuItems();
ToolStripMenuItem myItem = new ToolStripMenuItem("My Additional Item");
myItem.Click += myItem_Click;
Items.Add(myItem);
}
void myItem_Click(object sender, EventArgs e)
{
MessageBox.Show("additional item clicked");
}
}
private void JamExplorerMain_Load(object sender, EventArgs e)
{
shellListView1.BackgroundContextMenu = new MyBackgroundContextMenu();
}
See Also