Create Control At Runtime?

I've used control arrays at design time and runtime. The only thing missing is control arrays at design time. Their benefit? Being able to set known indexes at design time and position them to their exact location. Then you can write looping code against those controls easily. To mimic this in VS.NET, you have to create control arrays at run time and position them manually - not that hard, but nearly as convenient as using the designer. If you already wanted run-time control arrays then you're in luck as they're just as easy in .NET as VB6 and lower.

-nerseus
 
I can see where you coming from.... and going :)

Have you tried the option of extending on a collection, and creating your own implementation. (e.g. creating a strongly typed collection with different indexers)

BTW ... I heard that vs2003 will have new strongly typed collections/array's , (I can't remember what they called it) which make sense catering for control array's I suppose.... Chow
 
Having control arrays would have some benifit for developers...

When I first started messing around with visual basic many years ago, my first idea was to create a tetris like game using many image objects accessed by an index number on each image...

This allowed for an easy way of changing the squares on the tetris board...

If this feature were added to .NET then it would make accessing multiple objects with just a line of code or two much easier...

If not, I suppose one way around it would be to use a collection of object references where each one would reference every object you needed to access in a series of objects... Although that would take a considerably longer amount of time to code...

If Microsoft adds that feature then great! otherwise, there's always away around things...
 
I haven't tried extending any collection classes, but that would be really cool if someone did. :) Unfortunately, most of my .NET time is here at work where I don't have the luxury of programming such things for fun. But if someone else tries it, I'd be willing to donate a half hour a day to see if it could be done (pseudo-SourceForge style).

I doubt the end result would be very useful, but it would be a fun experience, I think.
 
Back
Top