private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
SolidBrush brush = new SolidBrush(dataGridView1.RowHeadersDefaultCellStyle.ForeColor);
int line = 0;
line = e.RowIndex + 1;
string s_line = line.ToString();
e.Graphics.DrawString(s_line,e.InheritedRowStyle.Font,brush,e.RowBounds.Location.X+15,e.RowBounds.Location.Y+5);
}
DataGridView增加序号
最新推荐文章于 2023-02-07 09:33:27 发布