Results 1 to 2 of 2

Thread: [RESOLVED] F5 key

  1. #1

    Thread Starter
    Addicted Member thedoc1's Avatar
    Join Date
    Jan 2002
    Location
    Scenic Tonawanda, NY
    Posts
    143

    Resolved [RESOLVED] F5 key

    I am writing a program where I need to have the F5 key available for refreshing the screen. I don't want to put the option in a menu. I was wondering if there was a way to program the F5 to be received from the keyboard.

    Thanks
    Last edited by thedoc1; Aug 2nd, 2007 at 03:54 PM.
    Thanks

    Doc

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: [RESOLVED] F5 key

    This will work for a single form. If want something that is application wide you would need to use subclassing or system hooks.
    Code:
    Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
        If KeyCode = vbKeyF5 Then
            debug.print "F5 pressed"
        End If
    End Sub
    
    Private Sub Form_Load()
        Me.KeyPreview = True
    End Sub

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