?
Solved

default form control amounts

Posted on 1998-12-18
3
Medium Priority
?
130 Views
Last Modified: 2010-05-03
Is there a way to change the limit of controls (labels, combo boxes, grid etc) on a form? Right now if you have 256 controls on a from you can not have any more. Is there a way to change that number?
0
Comment
Question by:MaryD
[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
3 Comments
 
LVL 10

Accepted Solution

by:
caraf_g earned 200 total points
ID: 1451297
You can get around this problem programmatically.

For each control type that you intend to use, just place one control of that type on your form, and give it an index of 0 (see properties). That will cause it to be part of a control array.

You can then create as many instances of the control as you like by loading each new instance:

Load Command1(1)
Load Command1(2)
Load Command1(3)
etc..

This is a real pain in the proverbial, you'll have to make each newly loaded control visible, position it and so on and so forth.
Also, all your control events, e.g. Command1_Click will now have an Index, and you will have to keep track of what each index number stands for. You will have to set captions, texts.... and so on.

But at least this will get you around the problem and it will allow you to have an "unlimited" amount of controls on your form.

(VB5, and I guess any VB version 4 and higher)
0
 
LVL 1

Expert Comment

by:OeilNoir
ID: 1451298
to tell you the truth, i don't know, but i would be very surprised there is a way. the limit is probably not imposed without reasons.. must be a VB momery limite or something...
like trying to enter a number higher than 256 in a Byte variable...

may i ask a question? why would you need more than 256 Controls on a form? try to create them at run time, that why the one you don't use won't be loaded...
0
 

Author Comment

by:MaryD
ID: 1451299
Thanks, actually I didn't even think about making arrays.
Yes that will be a real pain in the proverbial!!

Happy Holidays
0

Featured Post

Independent Software Vendors: 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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

770 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