Dynamic Variable Name Use in C# for WinForms

前端 未结 7 1633
余生分开走
余生分开走 2021-01-13 01:28

Not sure what is the best way to word this, but I am wondering if a dynamic variable name access can be done in C# (3.5).

Here is the code I am currently looking to

7条回答
  •  天命终不由人
    2021-01-13 02:02

    You can do that with reflection. But don't.

    It's more proper to instantiate a list of contols, add them programmatically to your form, and index that.

提交回复
热议问题