Penguen
Penguen

Reputation: 17268

How to run a WinForms application with a keyboard shortcut combination?

I try to run my WinForms app (Ctrl + Shift + R) with C#? like Bablyon dictionary:) I can not find any knowledgeable trick. Can you show me how to run app. with Ctrl + Shift combination?

I am using Visual Studio 2008, if it matters.

Upvotes: 3

Views: 4034

Answers (4)

Örjan Jämte
Örjan Jämte

Reputation: 14757

Thats a windows thing, isn't it? Open the properties dialog for the shortcut to you App. There you can press Ctrl + Shift + R in the Shortcut key textbox.

Upvotes: 1

scatman
scatman

Reputation: 14555

i usually create a shortcut and do this

Upvotes: 2

Cody Gray
Cody Gray

Reputation: 244672

I don't know what Babylon dictionary is, but chances are this is not implemented in C#. Windows has built-in functionality for launching applications with keyboard shortcuts. You can assign any combination you want to a particular shortcut, and whenever you press those keys, Windows will launch that program.

For example, you could assign the Calculator application to Ctrl+F12. To do this:

  1. Find or create a shortcut to the application you wish to launch. (Your Start menu or desktop is a good place to look.)

  2. Right-click on the shortcut, and select "Properties" from the drop-down menu.    

  3. In the Properties window, open the "Shortcut" tab and click in the "Shortcut Key" box.

  4. Press the key combination that you wish to use to start the application.        

  5. Finally, click OK. Now, pressing that key combination from anywhere should launch your application.

Upvotes: 6

Ohad Schneider
Ohad Schneider

Reputation: 38106

Are you referring to global hotkeys? Try this:

Best way to tackle global hotkey processing in c#?

Upvotes: 1

Related Questions