[WinForm]重绘DataGridView的序号

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/david_520042/article/details/6030833

        private void datagv_det_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            SolidBrush b = new SolidBrush(this.datagv_det.RowHeadersDefaultCellStyle.ForeColor);
            e.Graphics.DrawString((e.RowIndex + 1).ToString(System.Globalization.CultureInfo.CurrentUICulture), 
            this.datagv_det.DefaultCellStyle.Font, b, e.RowBounds.Location.X + 20, e.RowBounds.Location.Y + 4);
        }


展开阅读全文

没有更多推荐了,返回首页