Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 135
  • Last Modified:

default form control amounts

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
MaryD
Asked:
MaryD
1 Solution
 
caraf_gCommented:
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
 
OeilNoirCommented:
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
 
MaryDAuthor Commented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now