Groups | Blog | Home
all groups > dotnet compact framework > january 2006 >

dotnet compact framework : Menu keypresses "fall through" to application


_dtaylorus
1/7/2006 6:59:02 PM
I have a CF 1.0 application with a menu. When a menu item is selected by the
user, whatever key the user pressed is passed through to the application.

So, if the user presses "3", the event for menu item 3 is executed, and my
application receives KeyDown and KeyUp events for "3".

In fact, if the user presses "5" for "Exit", the application exits (via
Form.Close()), and the "5" keystroke is passed to the home screen, which
brings up all my contacts with first or last names starting with "J", "K", or
"L".

How can I prevent this from happening? I want the menu to handle the
keypress so it isn't passed on to the application underneath.

_dtaylorus
1/7/2006 7:12:01 PM
Correction: Only OnKeyUp is called. OnKeyDown and OnKeyPress are not called.

[quoted text, click to view]
Mark Arteaga
1/9/2006 6:24:44 AM
Are you setting KeyEventArgs.Handled = true? That should solve the problem.

________________________________________
Mark Arteaga
..NET Compact Framework MVP
http://www.neotericsdc.com | http://blog.markarteaga.com

[quoted text, click to view]


AddThis Social Bookmark Button