Hi!
I want to call some functions when a combination of key is pressed. But I don't know what is the event that I can track this combination.
Printable View
Hi!
I want to call some functions when a combination of key is pressed. But I don't know what is the event that I can track this combination.
Trap KeyDown event, and you will also need to set the KeyPreview property of the form true.
Actually the information provided is too little. If you can elaborate as to what you are actually looking for it would be easier to help.
If you want to be able to trap the key sequence even when your form does not have focus you should register a HotKey or use the GetAsyncKeystate API to detect which keys are being pressed
Set the KeyPreview property of the Form to true. And then use this codeRemember you will have to call the Save Function code from within the If Condition.VB Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyS And Shift = 2 Then 'call your save function here End If End Sub