dataGrid _RowPostPaint event함수 사용
그냥 복사해서 사용하면 됨 ( 사각형그리고 인덱스 숫자 그리고...)
private void dataGrid_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
Rectangle rect = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y,
dataGrid.RowHeadersWidth - 4, e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics, (e.RowIndex).ToString(), dataGrid.RowHeadersDefaultCellStyle.Font,
rect,dataGrid.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}// func
'Tip !!! > C# tip' 카테고리의 다른 글
현재작업디렉토리 (0) | 2022.07.27 |
---|---|
DataGridView 선택 Row Index 얻기 (0) | 2022.07.27 |
DataGridView Header 속성 편집 (0) | 2022.07.27 |
사용자정의 Control 에 있는 내부 컨트롤의 event 받기(1) (0) | 2022.07.26 |
C# 2진 파일 입출력 BinaryFile (0) | 2022.07.25 |