111,126
社区成员
发帖
与我相关
我的任务
分享if (e.Button == MouseButtons.Right)
{
if (e.RowIndex >= 0)
{
this.dgvWords.Rows[e.RowIndex].Cells[e.ColumnIndex].Selected = true;
int width = 0;
for (int i = 0; i < e.ColumnIndex; i++)
{
width += this.dgvWords.Columns[i].Width;
}
int height = 0;
for (int i = 0; i < e.RowIndex; i++)
{
height += this.dgvWords.Rows[i].Height;
}
this.cmsDelete.Show(dgvWords.PointToScreen(new Point(e.X + width, e.Y + height)));
}
}