Introduction: Ccrphotkey is a third-party control that makes it easy to implement hotkey functionality
Using the sample
You must be familiar with "ctrl+alt+z", right? Yes, it is the QQ Open message dialog box, the default hotkey, through this set of hot keys, we can very quickly open the message dialog box to see, greatly accelerate the speed of our operation. At the same time we also know that in the QQ system settings can be set on the hotkey (Figure 1), when we press any hotkey combination, the text box will display the hotkey combination in real time, let the user understand what the hot key is currently pressed.
Figure 1
Hotkeys can greatly speed up the user's operation, for developers, the use of hot keys in their own programs will also make it easier to operate, making the program more humane. Then you also want to implement like QQ, you can let users set the Hot key edit box? Let's use the example to introduce a very useful control ccrphotkey that can help you achieve powerful hotkey features easily.
The appearance of the Ccrphotkey control and many of its properties are similar to the properties of the text box that we are familiar with, so we can easily set it.
Step one: Start Visual Basic 6.0 first and create a new window.
Step two: Load the Ccrphotkey control and set its properties.
① Right-click in the Control toolbar, select "Part", click "Browse" in the pop-up window, locate the Ccrphotkey control, load it, and add it to the Form1 form in the appropriate place.
② Modify Ccrphotkey control properties. When you select the Ccrphotkey control, you can set it in the property settings area, where key combination settings are most important (Figure 2), and you can set up or disallow certain combinations as needed, such as prohibiting "ctrl+alt" combinations, Change the Allowctrlalt property to False, and so on. Of course, we can also change these properties dynamically in the process of running a program.
Figure 2