private void _knavTab_ShowContextMenu(object sender, ShowContextMenuArgs e) { if (e.KryptonContextMenu != null) { e.KryptonContextMenu.Tag = e.Item; } }
private void kryptonNavigator1_ShowContextMenu(object sender, ShowContextMenuArgs e) { // Yes we want to show a context menu e.Cancel = false; // Provide the navigator specific menu e.KryptonContextMenu = kcmNavigator; // Only enable the appropriate options kcmFirst.Enabled = (kryptonNavigator1.SelectedIndex > 0); kcmPrevious.Enabled = (kryptonNavigator1.SelectedIndex > 0); kcmNext.Enabled = (kryptonNavigator1.SelectedIndex < (kryptonNavigator1.Pages.Count - 1)); kcmLast.Enabled = (kryptonNavigator1.SelectedIndex < (kryptonNavigator1.Pages.Count - 1)); }
private void OnCellShowContextMenu(object sender, ShowContextMenuArgs e) { // Make sure we have a menu for displaying if (e.KryptonContextMenu == null) { e.KryptonContextMenu = new KryptonContextMenu(); } // Use event to allow customization of the context menu CancelDropDownEventArgs args = new CancelDropDownEventArgs(e.KryptonContextMenu, e.Item); args.Cancel = e.Cancel; OnPageDropDownClicked(args); e.Cancel = args.Cancel; }
private void KryptonCell_ShowContextMenu(object sender, ShowContextMenuArgs e) { var window = e.Item.GetDockWindow(); if (window != null) { var menuItems = new KryptonContextMenuItems(); window.OnShowTitleContextMenu(menuItems); if (menuItems.Items.Count != 0) { //should we create e.KryptonContextMenu if null ? e.KryptonContextMenu.Items.Insert(0, menuItems); e.KryptonContextMenu.Items.Insert(1, new KryptonContextMenuSeparator()); } } }