DataGridview 绘制行序号

RowPostpaint 事件

 

通过Rectangle(矩形的意思)对象绘制矩形区域,然后在通过textRenderer的DeawText方法来绘制序列号。

Rectangle(x,y width,height)

DrawText( IDeviceContext dc,text,font,Rectangle bounds,foreColor,TextFormatFlages);

 

Rectangle(x,y,width,height)

Drawtext(IDeviceContext dc,text,font,Rectanglebounds,forecolor,textformatflags);

posted @ 2018-03-26 16:06  WhiteSpace  阅读(635)  评论(0)    收藏  举报