PC Review


Reply
Thread Tools Rate Thread

Cant catch KeyDown event

 
 
Jørgen Sørensen
Guest
Posts: n/a
 
      11th Nov 2009
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




 
Reply With Quote
 
 
 
 
Jeff Gaines
Guest
Posts: n/a
 
      11th Nov 2009
On 11/11/2009 in message <4afae9da$0$1683$(E-Mail Removed)>
Jørgen Sørensen wrote:

>For some strange reason the code above never runs!


Does the form ever get focus or is focus set to the Acrobat reader?

--
Jeff Gaines Dorset UK
All those who believe in psychokinesis raise my hand.
 
Reply With Quote
 
Jørgen Sørensen
Guest
Posts: n/a
 
      12th Nov 2009

"Jeff Gaines" <(E-Mail Removed)> skrev i en meddelelse
news:(E-Mail Removed)...
> On 11/11/2009 in message <4afae9da$0$1683$(E-Mail Removed)>
> Jørgen Sørensen wrote:
>
> >For some strange reason the code above never runs!

>
> 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


 
Reply With Quote
 
Manny Harokopakis
Guest
Posts: n/a
 
      17th Nov 2009
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.


"Jørgen Sørensen" <(E-Mail Removed)> wrote in message
news:4afc4236$0$1692$(E-Mail Removed)...
>
> "Jeff Gaines" <(E-Mail Removed)> skrev i en meddelelse
> news:(E-Mail Removed)...
>> On 11/11/2009 in message <4afae9da$0$1683$(E-Mail Removed)>
>> Jørgen Sørensen wrote:
>>
>> >For some strange reason the code above never runs!

>>
>> 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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant catch KeyDown event Jørgen Sørensen Microsoft VB .NET 0 11th Nov 2009 07:21 AM
Catch KeyDown when menu open jrad Microsoft Dot NET Compact Framework 2 25th Aug 2009 08:24 AM
How to catch event KeyDown,KeyUp and KeyPress Tony Johansson Microsoft C# .NET 2 29th Jul 2008 02:35 PM
ListView Cannot catch keydown Event in vs.net 2005 beta2? Liren Zhao Microsoft Dot NET Compact Framework 0 21st Jun 2005 03:16 PM
Can not catch KeyDown message from RETURN key Roman Muntyanu Microsoft C# .NET 4 13th Jul 2004 07:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:37 AM.