private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
Color color = dataGridView1.RowHeadersDefaultCellStyle.ForeColor;
if (dataGridView1.Rows[e.RowIndex].Selected)
color = dataGridView1.RowHeadersDefaultCellStyle.SelectionForeColor;
else
color = dataGridView1.RowHeadersDefaultCellStyle.ForeColor;
using (SolidBrush b = new SolidBrush(color))
{
e.Graphics.DrawString((e.RowIndex+1).ToString(), e.InheritedRowStyle.Font, b, e.RowBounds.Location.X+20, e.RowBounds.Location.Y+6);
}
}
发表于 @ 2008年07月04日 17:12:00 | 评论( loading... ) | 举报| 收藏