Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximum number of controls on a form

Status
Not open for further replies.

brannon250R

Programmer
May 18, 2001
2
0
0
US
We have a tremendous number of controls that need to go on a form, for our project. We are currently using the ssTab control. Of course we hit the dreaded message... Maximum number of controls reached... or something to that effect.
Does anyone know how to fix it where i can use more than 256 control? We will have way more than 256 controls. Please help. Any suggestions are greatly appreciated.
Thanks,
Brannon
 
There are two options I can think of. One is to load the controls for each tab when the tab is activated (run time)and destroy them when the tab is deavtivated. Two is to make the project have multiple forms instead of multiple tabs.

-Sean
 
In the past I've seen stability problems with more than 150 controls on a form (mostly paint and navigation issues).

You can do like Sean suggests and create/destroy them on-the-fly. Or you can try consolidating some of the controls into one or more custom OCXes. But the best approach is to divide up your controls into multiple forms.

Chip H.

 
Over 200 controls on a single form is a GUI design that will drive your users crazy. . . you best option here is to either load controls at runtime as needed, or break the form out into seperate forms. - Jeff Marler B-)
 
I have a very similar problem to brannon250r's.

I found a Microsoft KB - Q229756, that discusses the max controls on form issue.

It suggests making a user control to contain many controls and adding that ONE user control to the form, replacing the many. I tried this and it looks like it's working.

I'm thinking I'll make one user control per tab on this particular form to clean things up. Anyone have any cautionary tales regarding user controls?
 
mcmmel -

Sure, that was my suggestion #2 to consolidate many VB controls onto one or more user controls.

My only suggestion is to Keep It Simple, and test test test!

Chip H.
 
This suggestion is over a year too late, but why not use a control array? Index your controls of the same type...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top