private void grdData_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
// RowPointPaint 이벤트핸들러
// 행헤더 열영역에 행번호를 보여주기 위해 장방형으로 처리
Rectangle rect = new Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
grdData.RowHeadersWidth - 4,
e.RowBounds.Height);
// 위에서 생성된 장방형내에 행번호를 보여주고 폰트색상 및 배경을 설정
TextRenderer.DrawText(e.Graphics,
(e.RowIndex + 1).ToString(),
grdData.RowHeadersDefaultCellStyle.Font,
rect,
grdData.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter);
}
'020. Prigraming > 01. C#' 카테고리의 다른 글
[C#] SMTP와 NAVER를 이용한 메일 보내기 (0) | 2016.08.01 |
---|---|
[C#] 이번달 마지막 날짜 구하기 (0) | 2016.02.12 |
[C#] 오라클 클라이언트 설치 없이 접속하는 방법 (0) | 2014.08.27 |
[C#] 윈폼에서 PPT 슬라이드 제어 (0) | 2014.03.31 |
[C#] 구조체 이렇게도 사용하는구나 (0) | 2013.08.02 |
WRITTEN BY
- 테네시왈츠
항상 겸손하게 항상 새롭게 항상 진실하게