I've just been cleaning u开发者_如何转开发p my program and I was checking how the tabs worked when I came across this very strange behaviour. My Main menu items were included in the tab order. Thinking that was strange I set their IsTabStop property to false, and ran it again.
They were no longer in my tab order but when I pressed ALT to activate the menu I could no longer use the arrow keys to navigate between the items.
Is there a way around this and make the menu act like a normal old school menu?
Here's how to exclude your menus from the tab order using KeyboardNavigation.TabNavigation
:
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="Open"/>
<MenuItem Header="E_xit"/>
</MenuItem>
</Menu>
<StackPanel KeyboardNavigation.TabNavigation="Cycle">
<TextBox Text=""/>
<TextBox Text=""/>
</StackPanel>
</DockPanel>
精彩评论