Link to home
Start Free TrialLog in
Avatar of strongd
strongdFlag for United States of America

asked on

Control limit on form

I am getting a message box saying  "Reached limit: Cannot create any more controls for this form", I know I have alot of controls on this form, they are main in a tabbed control.  But I was wondering if there was a way to get around this?  Maybe a fix patch or something?
Avatar of HMWT
HMWT

I can get abt 430 controls on a form before I get a out of memory error but I never get a too many controls error. it may be because I have most of my controls in arrays. this might make a diferance try putting all of your labels in 1 single array, or at least all the ones that will not need to be updated by code.
this may help.
I would have to agree.  Put them in a control array then unload and load them as necessary.  I am sure you dont need all those controls loaded at one time do you?

for instance you have 100 controls on tab1, when tab1 is selected

for i = 1 to 100
load label(i)
unload label(i+100)
next i

it's just a thought.  You can then use UBound to find out just how many controls you got Label.UBound
Just in case you don't know - to create a control array just put a control on your form. Then, there is an "Index" property - set that to 0.

As soon as you've done that you can use groone's method to add as many copies of that control as you like.

Groone is right.
There is a Pathc for VB5 an VB6 that should solve this problem. Just go to the Miucrosoft Web site and get it.

Avatar of strongd

ASKER

I looked all over the site.  I didn't find any patch for VB 5 for this problem.  Point me to the link, I'll give you the points....
create your own control that houses your other controls
i think that you can use collections of controls and manage it for every tab separately.
ASKER CERTIFIED SOLUTION
Avatar of FlorisMK
FlorisMK
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of strongd

ASKER

I'll go a head and try this...  Thanks