Solved

TabStrips and setting properties of control arrays

Posted on 1998-10-13
5
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

691 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