How many labels can a form suport

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

hi there, i'm developing an aplication that uses 4 forms.
Each form has about 2000 labels, when I try to open my
third form, an error ocurrs, but no error mesage appears.
I've realised that if I try to crate a form collection
like:

sub Test()
Dim f as new Form1
f.show
end sub

and if form1 has 300 labels and no other controls, the
program hangs, when the 33rd form appears (about 9900
labels).

What can I do to work this Out ?

Thanks
 
What I think you need to ask yourself is why are you adding 2000 labels to a
single form.
Are all 2000 displayed at the same time? Are all 2000 needed at the same
time all of the time?
If not than only create as many as are needed dynamically.
For Example:
If only 500 labels will be visible at any one time only create 500 labels
and then dynamically assign them their values based window size/scrolling
etc... or however else you determine which one's need to be displayed

-paul
 
Peter,

Can you explain what you are trying to do? It may be you actually want to
draw strings with GDI+ and not use labels.
 
I agree with Justin, If all you want to do is display a bunch of text at
specific positions than GDI+ is probably a much better approach.
-paul
 
Back
Top