如何在Windows应用程序中从LinkLabel中获得DataGridview控件?下面是我正在编写的代码,它可以得到值,但不能得到LinkLabel控件。DataGridViewCellEventArgs e) string name = this.dataGridView1.Rows[e.RowIndex].Cells["Name"].ToString();
LinkLabellabel; //Here I need to get the linklabel
它添加了5个LinkLabel,每个都有一个Click事件处理程序。标签上的文本是1...5,单击时应该会显示相同的结果,但当我单击每个标签时,我会得到相同的消息: 5。我认为我已经通过在循环的每次迭代中创建一个新的EventHandler和新的LinkLabel来避免这种情况。{}
foreach (Test t in objects)