码迷,mamicode.com
首页 > Windows程序 > 详细

DataGridView显示行号

时间:2020-02-08 00:21:43      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:div   cells   view   font   idt   row   wpost   pre   end   

 

Private Sub DataGridView1_RowPostPaint(sender As Object, e As DataGridViewRowPostPaintEventArgs) Handles DataGridView1.RowPostPaint
        Dim Rectangle As Rectangle = New Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, DataGridView1.RowHeadersWidth - 4, e.RowBounds.Height)
        TextRenderer.DrawText(e.Graphics,
                              (e.RowIndex + 1).ToString(),
                              DataGridView1.RowHeadersDefaultCellStyle.Font,
                              Rectangle,
                              DataGridView1.RowHeadersDefaultCellStyle.ForeColor,
                              TextFormatFlags.HorizontalCenter + TextFormatFlags.VerticalCenter)
    End Sub

 

DataGridView显示行号

标签:div   cells   view   font   idt   row   wpost   pre   end   

原文地址:https://www.cnblogs.com/rf8862/p/12274905.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!