WPF: the mnemonics button does not work if you put a button on the toolbar

If I put a Button in a ToolBar in WPF:

 <ToolBar FocusManager.IsFocusScope="False" Grid.Row="1" Name="tools" DataContext="{Binding Path=WeekNavigator}"> <Button Content="_>" Command="{Binding Path=CommandNavigateToNextWeek}"/> </ToolBar> 

The button text displays "_>" instead of ">", and the mnemonics do not work. If I move the Button outside the ToolBar , it works as expected.

How to make the button behave the same inside the toolbar (with respect to the mnemonics) as outside of one?

+6
button wpf toolbar
source share
1 answer

Try the following:

 <ToolBar> <Button> <AccessText>_></AccessText> </Button> </ToolBar> 
+7
source share

All Articles