Menu + Tab key

23 views
Skip to first unread message

Josh Smith

unread,
Sep 29, 2008, 11:23:49 PM9/29/08
to wpf-di...@googlegroups.com
Does anyone know why WPF's Menu control receives input focus when you navigate your UI with the Tab key?  I can't think of any application out there where the Tab key will bring input focus to the menu bar.  I'm looking for a way to prevent the Menu from being a tab stop, but no luck so far.  Setting IsTabStop and Focusable to false had no effect. The only solution I've found so far is to set KeyboardNavigation.TabNavigation to None on the Menu, but then you cannot tab between the menu items after clicking on an item (to intentionally give it focus). 

Any tips?

Thanks,
Josh

Andrew

unread,
Sep 30, 2008, 7:41:59 AM9/30/08
to wpf-di...@googlegroups.com
Maybe you can put the Menu into a panel and set the panel's TabNavigation to None (so you won't be able to tab into it) and the TabNavigation of the Menu to Cycle (so you can tab within the menu when it does have keyboard focus).

Josh Smith

unread,
Sep 30, 2008, 10:12:15 AM9/30/08
to wpf-di...@googlegroups.com
Thanks Andrew, I'll give that a try.

Josh

Karl Shifflett

unread,
Sep 30, 2008, 10:14:16 AM9/30/08
to wpf-di...@googlegroups.com

Josh Smith

unread,
Sep 30, 2008, 10:15:47 AM9/30/08
to wpf-di...@googlegroups.com
Awesome!  Thanks.
Reply all
Reply to author
Forward
0 new messages