我知道我可以通过以下方式分配gridview:
public static DataGridView grid = new DataGridView();
但我想要一个数组
像这样的东西
List<DataGridView> Grids = new List<DataGridView>();
// Assigning new DataGridViews
for (int i = 0; i < 5; i++)
Grids.Add(new DataGridView());
// Fetching one
DataGridView fetched = Grids[2];
你试过了吗:
DataGridView [] myArray = new DataGridView [5];
myArray[0] = new DataGridView();
// ...
尝试
public static List < DataGridView > grids = new List < DataGridView > ();