Cant catch KeyDown event

J

Jørgen Sørensen

Hi

I have a Windows Form with nothing but an Acrobat Reader Control, which is
docked to fill the entire form.
I need to catch KeyDown events to scroll, resize etc. the document shown in
the AR Control.
Just to test I have tried the "normal" way:

Private Sub Form_KeyDown(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
MessageBox.Show("hallo")
End Sub

The Form KeyPreview is set to True

For some strange reason the code above never runs!

Help please
Jørgen
 
J

Jørgen Sørensen

Jeff Gaines said:
Does the form ever get focus or is focus set to the Acrobat reader?

Yes, I guess it is a focus problem. I am trying to force focus to the form
whenever the AR has had it.

Jørgen
 
M

Manny Harokopakis

I believe KeyDown doesn't get called unless the parent form has the
KeyPreview flag set. If you need something outside the scope of a WinForm
or its components, you might want to check out user32.dll for some low-level
keyboard functions.
 

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

Similar Threads


Top