Maximum number of controls in a form

  • Thread starter Thread starter M
  • Start date Start date
M

M

There are a maximum number of controls can be put in a form for VB3 to VB6.
The BOL of VBNET do not say VBNET also has this limitation.

Because the clients want add more functions from time to time.
I find one of the form reach the maximum number of controls.
If I add one more control in this form, the program will get error at
InitializeComponent.

Are anyone find similar situation

Thanks
 
you are only limited by the amount of available memory or 32K child
controls, whichever is less.
 
M said:
There are a maximum number of controls can be put in a form for VB3 to
VB6.
The BOL of VBNET do not say VBNET also has this limitation.

Basically there is no such strict limit as in VB6. However, the number of
controls on a form is limited by memory and other factors.
Because the clients want add more functions from time to time.
I find one of the form reach the maximum number of controls.
If I add one more control in this form, the program will get error at
InitializeComponent.

What's the exact error message? Maybe it's time to refactor the user
interface and split up the huge form.
 
M,

We did some years ago a test in this newsgroup about how many controls where
possible.

The used number was so high that it would never be possible to put those in
a reasonable way on a form.

I hope this helps,

Cor
 
Thanks.
But where do you find the 32K.
There are thousands controls in the form but I believed no reach 32K
 
M said:
But where do you find the 32K.
There are thousands controls in the form but I believed no reach 32K

Really bad. I am wondering which controls you are using on the form. Maybe
some static controls such as labels and pictureboxes can be replaced by
drawing the text onto the form directly in its overridden 'OnPaint' method.
 
Back
Top