p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

csharptoday_discuss thread: Want to define shortcut key not in enumeration

Message #1 by "Frank Paris" <marshalt@s...> on 10 Dec 2001 13:56:24 -0800
The only way I've been able to figure out how to define a shortcut key

on a menu item under .NET is by setting the Shortcut property of the

menu item to one of the System.Windows.Forms.Shortcut enumerations, e.g.

this.menuItem4.Shortcut = System.Windows.Forms.Shortcut.CtrlV;

In my test application, this sets the shortcut key for my Edit->Paste

menu item to Ctrl+V.

However, the Shortcut enumeration is highly restrictive, leaving many

possible key combinations undefined. How would I set the shortcut of a

menu item to one of the key combinations not defined in this

enumeration? For example, Visual Studio.Net itself sets the shortcut key

of Help->Contents menu item to Ctrl+Alt+F1, which is not defined in the

enumeration. This is trivial under MFC. What am I missing, or is this an

oversight in the Beta 2, or is it a deliberate design decision? If a

deliberate design decision, how come Visual Studio.Net violates it?

Frank Paris


  Return to Index