Keypress?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using vb express, tryng to get a form to show up when I press f3 key, here's
code what am I doing wrong?


Private Sub Mcc120_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown

If e.KeyCode = Keys.F3 Then
Mcc120OpCmd.Show()
Me.Hide()
Else
MessageBox.Show("Invalid key")

End If


End Sub
 
Jerry said:
Using vb express, tryng to get a form to show up when I press f3 key,
here's
code what am I doing wrong?


Private Sub Mcc120_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown

If e.KeyCode = Keys.F3 Then
Mcc120OpCmd.Show()
Me.Hide()
Else
MessageBox.Show("Invalid key")

End If


End Sub

It should be e.KeyValue not e.KeyCode,
 
Back
Top