Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Strip Tab Stop & Tab Index

Status
Not open for further replies.

cyberbiker

Programmer
Mar 16, 2001
431
US
This is a long explaination. Hope it is not as confusing as my past posts
I am writing a program in VB using a tab strip.
I created a form with the tab strip, a frame(0) and one each of the required controls(0) on the form
I read a text file where the group headings are used as the caption for the tab and where each group heading has one and only 1 tab. At this point I create the additional needed tabs according to various criteria I get from that file. Each control is a part of an array and I have a counter telling me how many parameters are created in total. intParamCount as integer.
other than a label, the controls may be a text box, combobox, or check box. A text box may or may not be buddied to a up/down control.
a label is always to the left of a control.
basically it looks like this
lbl(intParamCount) TextBox(intParamCount)
lbl(intParamCount) cbo(intParamCount)

the variable intParamCount would be the same for the label and the other control.
I have no way to determine in advance in which order (TextBox, cbo,etc) they will be created.
The question is how do I set focus so that the first control other than a label receives focus when the form loads? Then When I select a tab, I would like the first control on that tab other than the label receive focus.
When I reach the last control, I would like the tab key to move it to the next tab on the tab strip or to a exit without saving control on the form itself (I have to decide that yet)
I cannot use the tag property of the control, since I am using that property to hold a default value for each control although, I guess I can probably find another solution to that problem if some one cannot help me with a more elegant solution.
Thanks
Terry Terry (cyberbiker)
 
put tab(0), lbl(0), txt(0), and cbo(0) on your form, IN THAT ORDER! Then place the lbl(1)/text(1)|cbo(1) on tab(0)and repeat for remaining controls on tab(0).

Load lbl(ctr)
With lbl(ctr)
.left = 100
.Top = 100
.Container = tab(0)
.Visible = True
End with

After finishing tab(0), then create tab(1). load controls, etc. until done. The control's tab order is determined by the order they are created, and Labels cannot recieve the focus.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top