Click here to Skip to main content
16,022,060 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use the i.e Altr+A as a save key. Like if the user press the Key Altr+A the entries become save.

This entry want with capture function. Guide me with an example.

Best regards,

Jatinder Gupta.
Posted
Updated 25-Jul-10 16:03pm
v3

Depending on the framework you're using, you may be able to catch the key press at the top level. Or you may need to add the key handler to every form, in which case, I guess you could write a global class that takes a keypress and acts on it, and write key press handlers that pass the key to that method.
 
Share this answer
 
Comments
Sandeep Mewara 25-Jul-10 3:30am    
OP comments: Resp Sir

You r right as want to catch the key. As explained want to catch the key as global.Pl provide some example code for the next.

Best regards,

Jatinder Gupta
I dont know about capture function, but for Alt+A to save you can use below given code in your form's KeyDown event

Private Sub frmFind_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles dgvFind.KeyDown<br />
        If e.Modifiers = Keys.Alt Then<br />
            If e.KeyCode = Keys.A Then<br />
                btnSave_click(sender, e)<br />
'or your code to save <br />
            End If<br />
        End If<br />
    End Sub


Hope this will help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900