WPF Equivalent for WinForms Ampersand (&) to Prefix Access/Accelerator Character

WPF uses an underscore character instead of the ampersand character (like with WinForms) to prefix an access (a.k.a. accelerator or mnemonic) key in the text of its elements like Label and Button.

You can escape the underscore by using two underscores.

The underscore replaces the ampersand because, in XAML, ampersands can easily lead to mistakes and cause problems.


Skip to main content