This may have been asked before but what I want to do is intercept Function Keys such as F8 at the form level and prevent them reaching an embedded Web Browser component. VB6 by the way.
Set the form's .KeyPreview property to true
Then, put code in the KeyUp (or KeyDown) event.
Start a new VB project with a single form.
Put in this code.
Code:
Option Explicit
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Call MsgBox("KeyCode: " & CStr(KeyCode) & vbCrLf & "Shift: " & CStr(Shift))
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
-George
Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
It works fine until I load a pdf document into the Web Browser. Then it doesn't fire and the PDF ActiveX PlugIn gets the F8 function key, which shows or hides it's menu bar.it is this behaviour that I want to stop.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.