Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Wed Jun 18, 2008 10:59 am Post subject: HOWTO : Display a different context menu than the default system context menu. |
|
|
To display your own context menu (or context menu strip) instead of the default system context menu, use the PopupContextMenu event as follows :
[C# ]
private void fldrView_PopupContextMenu(object sender, LogicNP.FolderViewControl.PopupContextMenuEventArgs e)
{
// This prevents FolderView from displaying its own context menu
e.Cancel = true;
// Show your own menu(strip) instead
contextMenuStrip1.Show(Control.MousePosition);
}
[VB .Net]
Private Sub fileView_PopupContextMenu(ByVal sender As System.Object, ByVal e As LogicNP.FileViewControl.PopupContextMenuEventArgs) Handles fileView.PopupContextMenu
' This prevents FolderView from displaying its own context menu
e.Cancel = True
' Show your own menu(strip) instead
contextMenuStrip1.Show(Control.MousePosition)
End Sub |
|