Solved

TabStrips and setting properties of control arrays

Posted on 1998-10-13
5
151 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

791 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