Profile Picture

NContextMenu Shift+F10 support

Posted By Brad Swearingen 13 Years Ago
Author
Message
Brad Swearingen
Posted 13 Years Ago
View Quick Profile
Forum Guru

Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 53, Visits: 3

I don't see a way to connect an NContextMenu to a control.  For instance, the "ContextMenuStrip" property of an NListView won't accept an NContextMenu in the VS Designer.  Is there a way to do this?

I'm assuming I'll have to issue the call to show the context menu during the mouse button up, Shift+F10 KeyDown and ProcessCmdKeys(Keys.App) instead.  This is working fine except for the Shift+F10 support.  I can get the NContextMenu to show during the Shift+F10 KeyDown but this key also causes the NMenuBar on the NForm to get highlighted and it gets the keyboard focus.  Shift+F10 seems to affect an NMenuBar like the Alt key does.  I don't believe it should do that.  Is there a way to stop the NMenuBar to get the keyboard focus when pressing Shift+F10?

To see Shift+F10 work like this just display from the Nevron Examples program any of the Docking Panels examples which have NMenuBars on them.  Put the keyboard focus on a widget which doesn't have a context menu and press Shift+F10 or Alt and both select the NMenuBar.



Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: 12 hours ago
Posts: 3,043, Visits: 3,777
Hi Brad,

Indeed, to display NContextMenu you need to call its Show method on some event.

To avoid Shift+F10 to select a command from NMenuBar you should attach to NCommandBarsManager.PreviewKeyUp and in the event handler to do the following:

private void nCommandBarsManager1_PreviewKeyUp(object sender, KeyEventArgs e)
{
   if (e.Shift && e.KeyCode == Keys.F10)
   {
      e.Handled = true;
   }
}




Best Regards,
Nevron Support Team



Brad Swearingen
Posted 13 Years Ago
View Quick Profile
Forum Guru

Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 53, Visits: 3
Thanks, that worked well.



Similar Topics


Reading This Topic