View Single Post
Old 05-06-2004, 11:44 AM   #4 (permalink)
AxelF
Crazy
 
AxelF's Avatar
 
Location: Europe
Just name them the same and they will be a collection. Then you access them using their index. Having 4 boxes they will be indexed 0-3. Like txtPlants(1) for the second one.
( It looks best in the code if you define global constants naming them:

cTrees = 0
cFlowers = 1 etc.

Then reference them like this: txtPlants(cTrees)
)


They will share the same code with the index passed into the sub if you have some code on Click for example.

By doing this you can loop through them like:

for i = 0 to 4

' your code here using this kind of reference: txtPlants(i)

next i
__________________
Coffee
AxelF is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76