I have a control array of Picture Boxes with 900 elements in it on one form. They are distributed over 6 frames on that form and only one frame will be visible at a time.

Now I have about 12 .gif files about 124K - 150K in size.

Each of these picture boxes needs to be loaded with one of the 12 images depending on the program logic durign run time. The Picture in the picture box can be changed at during rumtime say when a user clicks a certain button.

The Problem: The following code displays the error message out of memory

Private Sub Form_Load

Dim i As Integer

For i = Picture1.LBound to Picture1.UBound
Picture1(i).Picture = LoadPicture ("image07.gif")
Next i

End Sub


This displays an Error message "Out of memory"

However, if I replace the Picture1.UBound with 1400, it works - i.e, basically it has a problem loading all the images.

How to do this:
It would be really cool if I could use pointers of some kind. I could just load the 12 images I need and point each picture box to the address of the image in the memory or soemthing. Basically, to avoide to keeping copies of the same image in memory?


Is there any way I can do this.

It would super cool if I can do something like this:
Set Picture(1002).Picture = Picture(1003).Picture


Any ideas!!? esperate, please help