110,538
社区成员
发帖
与我相关
我的任务
分享
public void dg_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
DataGridView dg = sender as DataGridView;
//行序号
SolidBrush b = new SolidBrush(dg.RowHeadersDefaultCellStyle.ForeColor);
e.Graphics.DrawString((e.RowIndex + 1).ToString(System.Globalization.CultureInfo.CurrentUICulture), dg.DefaultCellStyle.Font, b, e.RowBounds.Location.X + 10, e.RowBounds.Location.Y + 4);
}