开发者

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

开发者 https://www.devze.com 2023-01-29 16:37 出处:网络
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 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 开发者_JAVA技巧2008, if it matters.


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.    

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

  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.        

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

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


i usually create a shortcut and do this


Are you referring to global hotkeys? Try this:

Best way to tackle global hotkey processing in c#?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消