Wpf menu tab stops strange behavior

I just cleaned up my program and I checked how tabs work when I came across this very strange behavior. My main menu items were included in the tab order. Thinking this was strange, I set my 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 move between items.

Is there a way around this and make the menu act like a normal school menu?

+4
source share
1 answer

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> 
+5
source

Source: https://habr.com/ru/post/1336895/


All Articles