Solved

Control limit on form

Posted on 1999-01-19
9
924 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
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
 

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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

One of the most frequently asked questions on EE in the "Windows Installer" zone is how to eliminate self-triggered installation of some product.  The problem occurs when, suddenly, whenever a certain application is launched, or even when a folder i…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now