DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   Max number of controls per form...... (http://www.daniweb.com/forums/thread23517.html)

MrConfused May 13th, 2005 7:06 pm
Max number of controls per form......
 
I use VB5 and I have a form which has very close to VB 5's limit of 255 controls per form which is starting to concern me. Can someone tell me if the limit for VB6 was increased and let's not forget VB net if possible (although changing the code to suit VB net sounds like a nightmare).

Thanks.

Comatose May 14th, 2005 3:16 pm
Re: Max number of controls per form......
 
The limit is also stillin place on VB6, I have no idea about .net, but I knew for certain that vb6 has that control limit in place (I just clicked about 255 times, on the toolbar to add a button). At button caption 254, I was told it couldn't add any more.

MrConfused May 17th, 2005 11:10 am
Re: Max number of controls per form......
 
Thanks. I'm surprised it was not increased. It seems a lot when you start, but I want the user to be able to do as many things as possible whilst in the one form. There are many ways to tackle the problem all of which make everything more difficult! Oh well......

Comatose May 17th, 2005 11:15 am
Re: Max number of controls per form......
 
One thing I have NOT tried, and I will when I get home from work is to see if you put them in a frame (container) or a tabbed dialog control if it will hold more, since the tabbed dialog control or the frame should be considered the parent.... it might allow for more than 254 per form, but limited to 254 frames or tabs, know what I mean?

MrConfused May 17th, 2005 1:30 pm
Re: Max number of controls per form......
 
Quote:

Originally Posted by Comatose
One thing I have NOT tried, and I will when I get home from work is to see if you put them in a frame (container) or a tabbed dialog control if it will hold more, since the tabbed dialog control or the frame should be considered the parent.... it might allow for more than 254 per form, but limited to 254 frames or tabs, know what I mean?

I just tried your idea. I created 253 Label controls. Then I created a frame taking the total to 254. I tried to add a label in the frame. No go. Worth checking out though. I don't know what a tabbed dialog control is! Maybe is is not with my version of VB (VB 5 learning edition).

I know you can redefine some of the controls as a control arrays. I have just been checking this out and it seems easier than I had thought.

Thanks.

Comatose May 17th, 2005 1:37 pm
Re: Max number of controls per form......
 
Control arrays are a breeze. The tabbed control I think is sp3 of VB6... I could be mistaken, but I think so. Control arrays are nothing more than controls of the same name with a different index. It really makes processing textboxes a lot easier too, so you can do something like:

for I = 0 to textboxname.count -1
    textboxname(I).text = vbnullstring
next I

I'll try it with the tabbed control when I get home (if I remember), but it seems the frame won't work :(


All times are GMT -4. The time now is 4:38 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC