Tab Index of form controls not working as expected
I'm blaming this on Trump :mad:
Have a form that I have added a bunch of labels, text boxes, and combo boxes to.
Working fine, happy with life, then my Trump election moment!!!!
Added an additional combo box which I want to be tab indexed as 3.
Went to the View->Tab Order option and manually clicked through the order I want things to be addressed 0, 1, 2 ,3 etc.
My new combo box however is still getting accessed as the last control on the form rather than the fourth one :eek:
Am I not doing something.
Please note this is a project that has been dropped in my lap, original coder has resigned and headed further north, and I haven't touched this stuff since the VB6 days.
Re: Tab Index of form controls not working as expected
Are some of your controls inside containers, because that affects the Tab order, e.g. a TextBox with a TabIndex of 2 inside a Panel with a TabIndex of 0 will be visited before a TextBox on the form with a TabIndex of 1. Can you take a screenshot of your form with all TabIndexes showing?
Also, keep in mind that the Tab order relates ONLY to the order in which controls receive focus when pressing the Tab key (or when calling SelectNextControl). If you're talking about the order they are accessed from the Controls collection of their parent then that is related to the z-order, not the Tab order. You can see and change the z-order in the Document Outline tool window.