C# winform DataGridView显示行标数字
private void DgvKaoshi_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { Rectangle rectangle = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, dgvKaoshi.RowHeadersWidth - 4, e.RowBounds.Height); TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(), dgvKaoshi.RowHeadersDefaultCellStyle.Font, rectangle, dgvKaoshi.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.Right); }
龙腾一族至尊龙骑

浙公网安备 33010602011771号