4

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.

Expenzor
  • 432
  • 1
  • 5
  • 17
Yuriy
  • 2,670
  • 6
  • 33
  • 48

2 Answers2

10

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.

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
0

You need to set the Tab Index. It will automatically handled. You can view/set the Tab index by

View > Tab Order menu

Anuraj
  • 18,859
  • 7
  • 53
  • 79