Location>code7788 >text

C# custom shortcut key implementation - Open Source Research Series articles

Popularity:515 ℃/2024-08-05 17:01:55

This time think about the use of shortcuts for applications.

Windows has provided an API function to be able to register the form of the hot key, and then you can use these registered hot keys in the form of the operation. So I have organized this operation, the registration of hot key operations written as a help class, and this blog post to record the use of this DEMO, easy for other readers to reuse the code.

 

1、 Project Catalog;

 

 

2、 Source Code Introduction;

1) Shortcut object;

 

 

2) Shortcut keys for registering and unbinding;

 

 

3) Configure shortcuts;

 

 

4) Use shortcuts;

 

 

3、 Run the interface;

 

 

4、 Introduction to use;

1) Refer to the code in the example for reuse.

2) Set a shortcut key in the configuration screen and click on that shortcut key on the form.

 

5、 Source download;

/download/lzhdim/89613676

 

6、 Other suggestions;

This example is a guideline, the rest of the reader is invited to reuse the code as needed.