How to paint only DataGridView's cell background not its content?

后端 未结 2 1242
故里飘歌
故里飘歌 2020-12-10 16:15

i need to paint only background of DataGridView cell not its Content.But while i\'m doing painting it paint its content too.Please help me out.

My code goes like th

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 16:48

    Should be

    e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, e.CellBounds.Bottom-1 , e.CellBounds.Right - 1, e.CellBounds.Bottom - 1);
    

    e.CellBounds.Right, e.CellBounds.Bottom - 1 point would be erased by next cell.

提交回复
热议问题