Winform右键单击单元格,弹出菜单

Public …..CellMouseUp(………..){
If(e.Button==MouseButton.Right){ 
This.dataGridView1.Rows[e.Index].Selected=true;
//二列
This.dataGridView1.CurrentCell= This.dataGridView1.Rows[e.Index].Cells[1];
//谈出菜单
This.contentMnueStrip.Show(This.dataGridView1,e.Index);
/./弹出在鼠标位置
contentMnueStrip.show(Cursor.Position)


}


}

相关内容推荐