Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Control limit on form

Posted on 1999-01-19
9
Medium Priority
?
934 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 40 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

971 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