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);

        }



WRITTEN BY
테네시왈츠
항상 겸손하게 항상 새롭게 항상 진실하게

,