|
-
Jan 29th, 2004, 04:41 PM
#1
Thread Starter
New Member
ShortCut Key for Image Button - URGENT
Hi,
I have a button with an image to perform a specific operation.
I want to use Alt-D as a shortcut key to simulate its click using the shortcut.
Any ideas would be appreciated much..
TIA,
Mohan
-
Jan 30th, 2004, 03:51 AM
#2
Lively Member
halu,
i'm kinda new. but this might help. use the button key down. try this.
Code:
Private Sub Button1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Button1.KeyDown
If e.Control AndAlso e.KeyCode = Keys.D Then
MsgBox("blah blah...")
End If
End Sub
but remeber, this only performs if focused...
--ayan
-
Jan 30th, 2004, 04:13 AM
#3
If you set the KeyPreview property of your form to True then you can use Ayan's suggestion in the KeyDown event of the form. This way it would fire as long as the form has focus, not just the button.
This world is not my home. I'm just passing through.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|