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
Solved

default form control amounts

Posted on 1998-12-18
3
127 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
3 Comments
 
LVL 10

Accepted Solution

by:
caraf_g earned 50 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 - Compare and highlight cell not the same 3 53
Child Form in front 4 49
Error with a code discussed on this page 5 29
transition to visual .net from vb6 5 36
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
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…

809 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