DataGridview 绘制行序号

RowPostpaint 事件

 

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

Rectanglex,y width,height

DrawText( IDeviceContext dc,text,font,Rectangle boundsforeColor,TextFormatFlages);

 

Rectanglex,y,width,height

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

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