Solved

Control limit on form

Posted on 1999-01-19
9
928 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

734 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