Being Pedantic - Do your buttons have a mnemonic?

Updated by Brady Stroud [SSW] 1 year ago. See history

123

<introEmbed
  body={<>
A mnemonic for a button is the letter which has an underscore, and the user can press the button using `Alt-<char>`.
  </>}
/>
<imageEmbed
  alt="Image"
  size="large"
  showBorder={false}
  figureEmbed={{
    preset: "badExample",
    figure: 'Bad example - All buttons without Mnemonic',
    shouldDisplay: true
  }}
  src="/uploads/rules/being-pedantic-do-your-buttons-have-a-mnemonic/../../assets/BadMem.gif"
/>

<imageEmbed
  alt="Image"
  size="large"
  showBorder={false}
  figureEmbed={{
    preset: "goodExample",
    figure: 'Good example - All buttons with Mnemonic - user can easily choose which button they want without a click',
    shouldDisplay: true
  }}
  src="/uploads/rules/being-pedantic-do-your-buttons-have-a-mnemonic/../../assets/GoodMem.gif"
/>

In Windows Applications, it is quite easy to assign a mnemonic to a button with the "&" character.

So for the case above, the text would be:

```cs
btnAbout.Text = "&About"
```

<asideEmbed
  variant="info"
  body={<>
    Learn more about the [Mnemonic property on Windows Desktop](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.label.usemnemonic?view=windowsdesktop-7.0&WT.mc_id=WDIT-MVP-33518).
  </>}
  figureEmbed={{
    preset: "default",
    figure: 'XXX',
    shouldDisplay: false
  }}
/>

Acknowledgements

Adam Cogan
Related rules

Need help?

SSW Consulting has over 30 years of experience developing awesome software solutions.