我的问题是:当我单击某个复选框时,如何从 DataGridView 获取当前复选框控件的索引这是我的 snick 代码
dataGridView2.RowCount = 5;
dataGridView2.ColumnCount = 4;
for (int i = 0; i < dataGridView2.ColumnCount; i++)
{
for (int j = 0; j < dataGridView2.RowCount; j++)
{
box = new CheckBox();
box.Text = "MyDate";
//box.Size = new System.Drawing.Size(15, 15);
dataGridView2.Controls.Add(box);
Rectangle rec = dataGridView2.GetCellDisplayRectangle(i, j, true);
box.Left = rec.Left;
box.Top = rec.Top;
}
}
}