private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex > 1 && e.ColumnIndex < 5)
{
bool t = (bool)dataGridView1[e.ColumnIndex, e.RowIndex].Value;
t = !t;
dataGridView1[e.ColumnIndex, e.RowIndex].Value = t;
dataGridView1.CurrentCell = dataGridView1[0, e.RowIndex];
dataGridView1.CurrentCell = dataGridView1[e.ColumnIndex, e.RowIndex];
}
}
原创
{
if (e.ColumnIndex > 1 && e.ColumnIndex < 5)
{
bool t = (bool)dataGridView1[e.ColumnIndex, e.RowIndex].Value;
t = !t;
dataGridView1[e.ColumnIndex, e.RowIndex].Value = t;
dataGridView1.CurrentCell = dataGridView1[0, e.RowIndex];
dataGridView1.CurrentCell = dataGridView1[e.ColumnIndex, e.RowIndex];
}
}