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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Contol Array stuff - (I'm just a beginner)

Status
Not open for further replies.

Cndn

Programmer
Nov 22, 2001
22
0
0
CA
I know this is kind of a stretch, but can someone explain to me what Control Arrays are, they're purpose, and how to make them ( you know, the required code). Thanks :)
 
Hi,

Then you place a control on a form, say a textbox : Text1 on Form1, you refer to it as Form1.Text1 (or just Text1 if your are in the code of Form1). If you have more than one textbox it coulde be called anything (Text2,Text3,MyText etc.), by you can also create a control array. If you do that the Textboses are called E.g. MyText(0), MyText(1), MyText(2), ....
To make a control array, place a control on a form and set the controls index property to 0.
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 

Control arrays are useful when you have a lot
of controls of the same type on your form that you
want to perform similar operations on.
They let you use the same code for all the controls.


This is from another posting

thread222-159795


Basically a control array is an array of controls
e.g. an array of text boxes
All of the text boxes have the same name (e.g. Text1)
and you refer to the individual items in the array
by using the objects "index". The index comes after
the object's name and in round brackets.
e.g. refer to the fifth item in your text box array Text1
like this: Text1(4) - remember that arrays start with zero. So, to set the value of this item type Text1(4).text = "whatever".
How to create a control array? Easy - just put a text box
on your form, select the text box and copy and paste.
The first time you copy a text box, it will ask if you want
to make a control array - click YES.
A copy of the text box is copied on top of the original.
You can grab it and move it to another position on the form.

You can also make a control into a control array
by setting it's "Index" value.

Any help?
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top