Solved

TabStrips and setting properties of control arrays

Posted on 1998-10-13
5
148 Views
Last Modified: 2010-04-30
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
Comment
Question by:ncw
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:mcix
ID: 1439793
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
 
LVL 1

Author Comment

by:ncw
ID: 1439794
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
 
LVL 4

Expert Comment

by:mcix
ID: 1439795
Good Deal...


0
 
LVL 1

Author Comment

by:ncw
ID: 1439796
This question is answered. Perhaps someone could explain when the 'TABS(n)' function should be used.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 50 total points
ID: 1439797
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now