Keypress?

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
 
M

Mr. Arnold

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top