ShellTreeViewBeforeShowContextMenu Event |
This event is called before the ShellContextMenu is displayed.
You may use it to cancel the context menu appearing or to modify the custom menu entries in the ContextMenuStrip.
Namespace:
Jam.Shell
Assembly:
ShellBrowser (in ShellBrowser.dll) Version: 7.1
Syntax public event EventHandler<ShellTreeSelectionCancelEventArgs> BeforeShowContextMenu
Public Event BeforeShowContextMenu As EventHandler(Of ShellTreeSelectionCancelEventArgs)
public:
event EventHandler<ShellTreeSelectionCancelEventArgs^>^ BeforeShowContextMenu {
void add (EventHandler<ShellTreeSelectionCancelEventArgs^>^ value);
void remove (EventHandler<ShellTreeSelectionCancelEventArgs^>^ value);
}
member BeforeShowContextMenu : IEvent<EventHandler<ShellTreeSelectionCancelEventArgs>,
ShellTreeSelectionCancelEventArgs>
Value
Type:
SystemEventHandlerShellTreeSelectionCancelEventArgsRemarks When modifying the context menu, you may set the following properties of single items:
Checked,
Enabled,
Visible.
Examples
The following example refers to a ShellList.
private void ShellListView1_BeforeShowContextMenu(object sender, ListSelectionCancelEventArgs e)
{
((ToolStripMenuItem)contextMenuStrip1.Items[0]).Visible = e.Selection.Count == 1;
}
See Also