Jump to content
Sign in to follow this  
Mr.Grim

C# Hotkey Field

Recommended Posts

Hey Everyone, I'm going crazy because I can't figure out hot to add a hotkey field in my Visual C# program. In C++, all I would have to do is add a Dialog resource and then under the Dialog Editor there would be HotKey Field right there. I can't seem to figure out how to add a Dialog resource in C#, or where to find the Hotkey component.

 

By Hotkey Field, I mean the little box that is like a text box, except it recognizes hotkeys. Like when you hold down control and hit a Q, it would show as CTRL+Q.

 

Does anyone know how to add one of these with Visual C#??

Share this post


Link to post
Share on other sites

You mean functionality like when you type Control-S and it saves a document in Word? If not then sorry, I don't know what you're asking.

 

You can do that like this:

System.Windows.Forms.MenuItem saveMenuItem = new System.Windows.Forms.MenuItem();
saveMenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlS;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...