I have a Windows Forms application and on one of the forms there is a TabControl and inside one of the tabs I have multiple Textboxes with each of them having the TabIndex set to values 1->9. When the form is loaded, one of the textboxes (with tabIndex 5) is given focus and the textbox with TabIndex 6 is disabled. When the user fills out the first field and hits tab the focus does not go to the next textbox instead it goes to the Save Button which is outside the TabControl and has a TabIndex of 13. I can't figure out why the textbox (With Index 7 that is below and to the left of the one with Index 5) doesn't get the focus.
3
votes
You don't have the TabStop property set to False, do you?
– Brandon
Below and Left don't matter, it's all about the indices. Maybe [MAKE a BACKUP 1st] use the View|TabOrder feature to set it up.
– Henk Holterman
Are the textboxes actually in the tab control container? Or are they sitting on the form, dragged over top of the tab control?
– Jon Seigel
2 Answers
5
votes
When you have the form in design mode, in 'View' menu, there is an option 'Tab Order' that allows you to set tab order by just clicking on controls in the sequence you like. It also helps you in visualising the tab order for controls in other containers too (like controls in a panel).
This way you can not only see if the controls have right order but also if thet have right parent (container) too.
Vijay
1
votes
I realize how old this thread is, but I am sure someone will come across it again. The reason is if you have controls in GroupBoxes, the GroupBox index could be influencing the general flow. Ensure you number the GroupBox in sequential order and then sub-index the controls within the groups and you should be fine.