winfrom 最左侧的,我想绘制序列
代码如下:
private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
DataGridView dg = (DataGridView)sender;
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dg.RowHeadersWidth,
e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
dg.RowHeadersDefaultCellStyle.Font,
rectangle,
dg.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}
但是里面的星号还在,怎去掉*号?
*表示当前行是新行,不需要去掉啊。
谢谢,让我没明白*的含义
http://download.csdn.net/detail/ConExpress/791182你去看参考一下这个
重新建一个序号列,不更好么?画上去的样式不太好控制!