1
이것이 가능한지 확실하지 않지만 DataGridView 셀 안에있는 단추의 인스턴스를 가져 오려고합니다. (C# .net 및 windows 폼 작업)DataGridView 셀 안에있는 버튼의 인스턴스를 가져 오는 방법은 무엇입니까?
이 이유는 버튼 근처에 컨트롤이있는 패널을 팝업하고 싶기 때문입니다. 그래서 그 위치가 필요합니다. (이것이 가능한가?).
나는 CellClicked 이벤트 처리기에서 버튼 클릭을 처리 해요 :
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
Int32 id = (Int32)dataGridView1[0, e.RowIndex].Value;
if (e.RowIndex < 0 || e.ColumnIndex != dataGridView1.Columns["NewDate"].Index)
{
if (e.RowIndex < 0 || e.ColumnIndex != dataGridView1.Columns["Delete"].Index) return;
else
{
}
}
else
{
//Button button - the button I'm trying to get
panel2.Location=new Point(button.Location.X,button.Location.Y);
}
}
답을 확인 했습니까? –