Re: Out of Memory - Forms
Have you tried closing any other open forms - I had a similar problem and that seemed to helps. In addition global variables especially arrays use a lot of memory so trying using local ones wherever possible.
Re: Out of Memory - Forms
Hello Andrew,
I dont have any other form open, while opening this big form and I dont have any global variable arrays, just a couple of string global variable.
I dont think this has anything to do with the available system resources, as I encounter the same problem with 32, 64 and 128 MB RAM - PII and PIII systems, running Windows 95/98.
Thank you
Regards
Re: Out of Memory - Forms
You may not like this solution and it might not work, but here goes. First, save a copy of your form for backup purposes. Next, Delete all of the labels off of the picture box. Run your form to see if you are still getting the out of memory error. If you do, this solution won't work. If the out of memory error does not show up, you will have to label everything through code. Do it like this.
<vbcode>
Option Explicit
Private Loading As Boolean
Private Sub Form_Activate()
If Loading Then
Picture1.Cls
Picture1.CurrentX = 50
Picture1.CurrentY = 50
Picture1.Print "First Label"
Picture1.CurrentX = 250
Picture1.CurrentY = 250
Picture1.Print "Second Label"
Picture1.CurrentX = 450
Picture1.CurrentY = 450
Picture1.Print "Third Label"
Loading = False
End If
End Sub
Private Sub Form_Load()
Loading = True
End Sub
</vbcode>
Yes this will be a real pain in the @#$. The only other way I can think of at the moment will be to break things up into different forms.
Hope this helps
Re: Out of Memory - Forms
>, but within each array there are a few hunderd controls.
Do you mean you made an array of -say- 200 textboxes? Like text1(0) to text
(199)? How can you make all those control to be visible at same time?
Maybe you can:
a)use the Datarepeater control (=Microsoft DataRepeater control)
b)use only as many controls as you can show, and recycle them when need
to show other informations
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater