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

随声附和 提交于 2019-12-10 13:15:08

问题


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)


回答1:


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).



来源:https://stackoverflow.com/questions/5728400/what-is-the-purpose-of-a-keyboard-mnemonic-on-a-label-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!