Base window events are triggered when my focus is on another form on its top

paridhillon

New member
Joined
Apr 3, 2009
Messages
3
Programming Experience
3-5
I am migrating my code from vb.net 1.1 framework to vb.net 3.5
I am noticing a strange behavior and would like someone to help me.

In my windows application, the base window has some buttons and events are written for the same.
I have shortcuts defined for these buttons also, for example: ctrl+d, DEL (keyboard) etc.

Now i open a property Grid form on top of my base window for a selected object.
Even when the focus is on this property grid, i am noticing that my base window events are firing on pressing those
shortcuts.

example:
I select some text in my property grid and hit delete button from keyboard. The delete event that i have written for
the selected object gets fired and the text is not deleting.

I fail to understand why is it happening. It wasnt behaving like this in .net 1.1.
In .net 1.1 it would delete the text and only when the focus is back on the base window, hitting Delete would call
the event.

How do i control such a behavior? Is there some property that i need to set for property grid in .net 3.5 to prevent
base window events from firing till the time focus is on property grid form?
 
please note i am using form.show() mechanism to see the form.
I do not wish to use form.showdialog() because i want my base form to be reachable.

But form.show() keeps all the events of the base window activated even when my focus is on the topmost form.
 
Back
Top