我知道我可以通过以下方式分配gridview:
public static DataGridView grid = new DataGridView();
但我想要一个数组
答案 0 :(得分:1)
像这样的东西
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];
答案 1 :(得分:0)
DataGridView [] myArray = new DataGridView [5];
myArray[0] = new DataGridView();
// ...
答案 2 :(得分:0)
试
public static List < DataGridView > grids = new List < DataGridView > ();