Is there any good way in Windows Forms Designer to have an array (or other collection) of similar components defined? You can check “GenerateMember”, which will give you a unique named member in code to reference, but what if I want that generated member to be one of a list of some sort, so that I can iterate through them easily? The only way I can think of is to create a new list on load, and the manually add all the already-generated members to that list, which is tedious and redundant. I thought about editing the code that generates these components, but it’s inside that auto-generated “Do not modify” section, and I’m afraid any change I make there will be overwritten any time I make other changes to the form. Does the Form Designer just not have this functionality?
Share
If I understand your question correctly, you can simply cast “this” (the form) to a “Control”, and then examine it’s “ControlCollection” property- a collection containing the form’s controls. Eg.
Unless I am missing something…