dotnet / dotnet/wpf

RecognizesAccessKey hard coded to true in Label style

Open
#3,877 7 comments 3 reactions 0 assignees View on GitHub
API suggestion
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

The "RecognizesAccessKey" of the content presenter of the default label style is hard coded to true (and has been for many years). As a result the first underscore of a label disappears (I have ran into this problem more than I have seen users actually use a mnemmonic).

Multiple work arounds for that problem exist:
- Using a TextBlock: This is the most acceptable solution but applying an implicit style to the TextBlock is not possible as it is used in other components/style libraries as well.
- Override the default Label style: Works as well but, you have to remember to do it in every application, and if you are using an external style library this becomes very difficult.
- Add an extra underscore to the text: this is bad beyond words.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.