Capturing delete key and assinging access key to toolbar's button
Hi All
just wanna ask that how would you capture the delete key in you visual basic programm. i tried Ascii but it doest recognize the delete key ..
So if i wanted to know that if user has presses delete key what would i would do my coding to perform a perticular task
and yes one more question that how would i assign a access key to toolbar's buttons
Hoping for your valuable suggestions
Kirun
Re: Capturing delete key and assinging access key to toolbar's button
Dear Kirun,
write the code in key down event of form rather than key press event. Also, make sure KeyPreview propery of the form is set to true.
The following code displays a message box when you press delete key.
private Sub Form_KeyDown(KeyCode as Integer, _
Shift as Integer)
If KeyCode = vbKeyDelete then
MsgBox "Delete key is pressed.", _
vbExclamation
End If
End Sub
Hope this will work
All the best.
Kishore.