Catch KeyDown when menu open

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
 
A

Amit

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
 
Z

Ziddan

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
 

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

Top