因为DataGridView的Button列是由Graphics绘制上去的,而不是真正的Button控件
Code

private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.ColumnIndex == 0)
{
e.Handled = true;
using (SolidBrush brush = new SolidBrush(Color.Green))
{
e.Graphics.FillRectangle(brush, e.CellBounds);
}
ControlPaint.DrawBorder(e.Graphics, e.CellBounds, Color.Yellow, ButtonBorderStyle.Outset);
}
}