Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of a keyboard mnemonic on a label control?

What's the point of adding mnemonic on a label control in C#?

I have a label with the text "&SomeText".

What event is triggered when i press ALT+S (I've tried OnClick but it's not fired)

like image 412
Gabriel Avatar asked Apr 20 '11 09:04

Gabriel


1 Answers

The point of adding a mnemonic is to increase the accessibility of your app by reducing the reliance of a user on the mouse.

If you have a control that has a tabindex directly after the label, then invoking the mnemonic will fire the "enter" event on the control. You will notice the focus shift to this control.

So, the mnemonic is not for the label itself, but actually for the control next to it (+1 in the tab order).

like image 178
James Wiseman Avatar answered Oct 27 '22 19:10

James Wiseman