• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

TabStrips and setting properties of control arrays

I am using a tabstrip in VB4 32bit with an array of picture boxes. On form load I want to set the properties of controls in the picture boxes, eg:

TabStrip1.Tabs(0).picframe.opt1.value = True

but I get an error message which says:

"Index out of bounds"

Can you help?
0
ncw
Asked:
ncw
  • 2
  • 2
1 Solution
 
mcixCommented:
The Tabstrip is a 1 based collection. Meaning the Tabs Collection starts at 1 not 0.

Try:

TabStrip1.Tabs(1).picframe.opt1.value = True

0
 
ncwAuthor Commented:
I realise the index in the tabstrip control's properties starts at 1, but I have seen reference to 'Tabs(0)' in connection with the tabstrip in a help file.

Anyway, I've solved the problem. I was trying to reference a control in a picturebox array on a tab strip. It appears that I do not need to include any reference to the tab strip or picturebox, but can instead reference it as:

FormName.ControlName.Property  - as normal
0
 
mcixCommented:
Good Deal...


0
 
ncwAuthor Commented:
This question is answered. Perhaps someone could explain when the 'TABS(n)' function should be used.
0
 
MirkwoodCommented:
The tabs(n) can be used if you want to set a property of a tab like the name.

tabs(1).Caption = "Tab 1"
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now