Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to focus Textbox with Alt + letter

I need to quick focus the text box using Alt+Letter combination. In my form for each textbox is a label. For this label I can specify name as '&My Label' and M letter will be underlined when I press the Alt button. But how I can focus the textbox (in winforms)?

P.S. As I remember WPF has possibility to bind label with textbox. And if label get focus textbox will get focus automatically.

like image 466
Yuriy Avatar asked Dec 28 '22 20:12

Yuriy


1 Answers

This works automatically. Just make sure the TextBox you want to focus is the next one in the tab order, i.e. if the Label has TabIndex = 0, the TextBox needs TabIndex = 1.

like image 88
Daniel Hilgarth Avatar answered Dec 31 '22 12:12

Daniel Hilgarth