Creating an array of controls in Visual Studio

In my C# project where I'm making a pilot file editor for the old X-Wing game, I followed the suggestions you all provided to abstract the data being read into different classes and hold that data in lists and arrays. It's working great.

Now, I'm facing the challenge of displaying all of that data on my form. One method would be to drag and drop a number of checkboxes, labels, numericupdown's, etc and then manually map my data structures to these controls. This seems to be another process that is ripe for optimization.

Is there a way to create and work with an array of controls? IF so, I could loop through my arrays and lists and assign the data via index rather than do them one at a time. And it would be nice to use the drag and drop functionality of the form designer to make the forms.

by LordDrakken via /r/csharp

Leave a Reply