"Amos Soma" <amos_j_soma@y_ a_hoo.com> wrote:
In my Win form, I have KeyPreview set to True.
In my form KeyUp method, I have the following
code:
[...]
The message is displayed correctly. However, focus
moves off my form and unto my menu, even though
I have e.Handled set to true.
What operating system are you using? I can't reproduce this on Windows
XP Professional. Whether KeyPreview is true or false, F10 only goes to
the menu if I do *not* set e.Handled = true.
Anyway, my first suggestion is not to use F10, because it's a standard
Windows shortcut for going to the menu bar. It's a bit like assigning
your own special meaning to the Start key - it will no longer perform
its proper function.
Otherwise, I suppose you'll have to do something messy like
temporarily disabling the menus in your KeyUp handler and re-enabling
them afterwards.
P.