using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace Costaco.CTN.Controls
{
public class DataGridView : System.Windows.Forms.DataGridVIEw
{
public DataGridVIEw()
{
}
//這裡鍵入override,然後空格就會出來重寫的列表,你選一個回車就可以了寫出不同的override
protected override void OnRowPostPaint(DataGridVIEwRowPostPaintEventArgs e)
{
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, this.RowHeadersWidth - 4, e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics, Convert.ToInt32(e.RowIndex + 1).ToString(), this.RowHeadersDefaultCellStyle.Font, rectangle, this.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
base.OnRowPostPaint(e);
}
}
}