Results 1 to 12 of 12

Thread: Keydown Question

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2007
    Posts
    63

    Keydown Question

    I have a form with two buttons. I would like to add keyboard shortcuts for those buttons and have looked through all of the postings I could find on this topic. I did see one post which had the code below.

    It works for the first time that the user presses F2 but only that one time. Can you please help out a newbie?
    vb Code:
    1. Private Sub PB_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    2.         If e.KeyCode = Keys.F2 Then
    3.             MsgBox("pushed F2")
    4.         End If
    5.     End Sub
    Last edited by dtgreer; Nov 12th, 2007 at 03:17 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width