View Full Version : quick question on how to set keys as clicks
tman11580
12-06-2008, 09:21 PM
in visual basic 2008 express how do i set a key to do something like the enter key to = a button click like that type of thing?
Edit: i want to make it so when i press the enter key it makes for example button1 get pressed
oracleguy
12-07-2008, 07:19 PM
There is a KeyPress event for the form you can use to see when a key is pressed and which key it was. Using that you can do what you want.
tman11580
12-10-2008, 12:03 AM
yeah i know but im not sure how exactly how to use it, do you have to make a sub or is it just there somewhere? im reletively new to programming
tman11580
12-10-2008, 12:11 AM
ok so i have the sub set up but im not sure how to write it out..im gunna keep trying though, a little help would be much appreciated
tman11580
12-10-2008, 12:16 AM
i have the keypress sub set up, i have this so far, not sure if its right
Private Sub go_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles go.click
End Sub
im not sure how to code the enter key to make the "go" button click
"go" is the name of the button
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.