private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
    {
        if (e.RowIndex >= 0)
        {
            DataGridViewColumn column = dataGridView1.Columns[e.ColumnIndex];
            if (column is DataGridViewButtonColumn)
            {
                //这里可以编写你需要的任意关于按钮事件的操作~
                MessageBox.Show("按钮被点击");
            }
        }
    }

 

相关文章:

  • 2022-01-02
  • 2022-12-23
  • 2022-02-19
  • 2022-03-01
  • 2022-02-11
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2022-01-26
相关资源
相似解决方案