111,108
社区成员




private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if(e.ColumnIndex==1 && e.RowIndex!=-1) //控制显示的列
{
bool val =Convert.ToBoolean(e.Value); //控制画checkbox的单元格
if(val)
{
e.Handled = true;
Rectangle rc = e.CellBounds;
ControlPaint.DrawCheckBox(e.Graphics, e.CellBounds, ButtonState.Checked);
}
}
}