Reputation: 45096
The underscore does not hotkey
It there a way to format a textblock and still hotkey
<Button Grid.Row="4" Grid.Column="0" x:Name="btnClearSearch"
Click="ClearSearch_Click">
<Button.Content>
<TextBlock>
<Run Style="{StaticResource RunSymbol}"></Run>
<Run Style="{StaticResource Button}">_Clear</Run>
Upvotes: 0
Views: 18
Reputation: 14153
You can not add a hotkey to a TextBlock, as it is different than a label and is not actually an interactable Control
, but a FrameworkElement
.
See Differences between Label and TextBlock. In this case, you will need to use a Label and play around with the margin and padding to get it to look the same as two Runs in a TextBlock.
You may also want to look at the AccessText control.
Upvotes: 1