Catch KeyDown when menu open

  • Thread starter Thread starter jrad
  • Start date Start date
J

jrad

Is there a way for the open form in my CF application to catch keydown
events when a menu is open?

My breakpoint in OnKeyDown() does not get hit when I press a key and I
have already set the KeyPreview property to true for my form.

Thanks,
JR
 
Is there a way for the open form in my CF application to catch keydown
events when a menu is open?

My breakpoint in OnKeyDown() does not get hit when I press a key and I
have already set the KeyPreview property to true for my form.

Thanks,
JR

Hi JR,

I dont think so you will get any Key event in the form when your Menu
is active.
But i guess you can handle the Menu related events to do your
oprations insead of KeyDown.

Regards,
Amit R
 
Is there a way for the open form in my CF application to catch keydown
events when a menu is open?

My breakpoint in OnKeyDown() does not get hit when I press a key and I
have already set the KeyPreview property to true for my form.

Thanks,
JR

You can get Event while menu is open ( use you custom mainMenu in
place of Default i.e work similer )

//Create Custom sub-menu
MenuItem mn = new MenuItem();
//register the event handler
mn.Click += new EventHandler(handleSoftKeyAction);
//Add custom sub-menu in Main Menu
this.Menu.MenuItems.Add(mn);

I hope this will help you out...

Vinod Bhatia
 
Back
Top