JamBaseShellListViewBeforeShowContextMenu 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<ListSelectionCancelEventArgs> BeforeShowContextMenu
Public Event BeforeShowContextMenu As EventHandler(Of ListSelectionCancelEventArgs)
public:
event EventHandler<ListSelectionCancelEventArgs^>^ BeforeShowContextMenu {
void add (EventHandler<ListSelectionCancelEventArgs^>^ value);
void remove (EventHandler<ListSelectionCancelEventArgs^>^ value);
}
member BeforeShowContextMenu : IEvent<EventHandler<ListSelectionCancelEventArgs>,
ListSelectionCancelEventArgs>
Value
Type:
SystemEventHandlerListSelectionCancelEventArgsRemarks When modifying the context menu, you may set the following properties of single items:
Checked,
Enabled,
Visible.
Examples
private void ShellListView1_BeforeShowContextMenu(object sender, ListSelectionCancelEventArgs e)
{
((ToolStripMenuItem)contextMenuStrip1.Items[0]).Visible = e.Selection.Count == 1;
}
See Also