Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does an Access Key do for a Label in .NET Windows forms?

Someone enlightened me yesterday to the fact that Labels can have access keys. So I set a Label's text property to Class &A and, indeed, it now has an underline and everything. As far as I can tell, though, Labels can't get the focus.

So what does this Access Key do; if nothing, then why are they allowed anyway (TextBoxes do not have Access Keys)?

like image 354
jtpereyda Avatar asked Oct 27 '25 02:10

jtpereyda


1 Answers

When you use Label.UseMnemonic with an "access key", and then press that access key (ie: Alt+A in your example), the control next in the tab order (based on TabIndex) on the form will receive focus.

like image 195
Reed Copsey Avatar answered Oct 28 '25 19:10

Reed Copsey