Solved

Control limit on form

Posted on 1999-01-19
9
929 Views
Last Modified: 2013-11-13
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?
0
Comment
Question by:strongd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 

Expert Comment

by:HMWT
ID: 1469455
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.
0
 
LVL 3

Expert Comment

by:groone
ID: 1469456
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
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1469457
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:VB6User
ID: 1469458
There is a Pathc for VB5 an VB6 that should solve this problem. Just go to the Miucrosoft Web site and get it.

0
 

Author Comment

by:strongd
ID: 1469459
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....
0
 
LVL 1

Expert Comment

by:rondeauj
ID: 1469460
create your own control that houses your other controls
0
 

Expert Comment

by:israelw
ID: 1469461
i think that you can use collections of controls and manage it for every tab separately.
0
 
LVL 2

Accepted Solution

by:
FlorisMK earned 10 total points
ID: 1469462
There is a simple solution, both controlcount-wise and performance-wise (one of the tips I always give at the end of Mastering VB5): design a group of controls, create an image (screen capture) of the group, use the image in stead of the controls, and write code to capture the mouseclicks and parse them; in effect, create an image map that looks like your controls. Disadvantages are many (your 'controls' will not assume Windows system colors anymore), but you will see a significant performance increase and not have the problem with too many controls anymore.
0
 

Author Comment

by:strongd
ID: 1469463
I'll go a head and try this...  Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question