//添加下面事件即可
        private void DataGridView_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                if (e.Button == System.Windows.Forms.MouseButtons.Right)
                {
                    this.Rows[e.RowIndex].Cells[e.ColumnIndex].Selected = true;
                   
                }
            }
        }

相关文章:

  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2021-05-28
猜你喜欢
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2021-06-29
  • 2021-11-01
  • 2022-12-23
相关资源
相似解决方案