Question Detect keystroke in datagridview

LeonLanford

Active member
Joined
Dec 2, 2008
Messages
28
Programming Experience
Beginner
Hi.. I'm having problem with keystroke detection, I want to detect only "enter" and "I" keystroke.

If you press "enter", it will automatically close the form the datagridview located and send data to other form, I'm using keydown function, but I don't know how to detect only "enter" and "I" keystroke, usually I'm browsing datagrid with tab button, but when I press tab, it also closed down.. :(

here's the code

VB.NET:
    Private Sub dgv_mhs_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles dgv_mhs.KeyDown
        masukin()   'send data to other form

        Me.Hide()  'close this form
        Form1.Show() 'show the first form
    End Sub
 
under manuskin(), type the line:

e.

and look at the Intellisense for the KeyEventArgs object.. Or look it up in MSDN
 
Back
Top