zoukankan      html  css  js  c++  java
  • datagridview 添加行号

    //显示datagridview 行号
    private void kryptonDataGridView_sublstsfc_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
    {
    System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(e.RowBounds.Location.X,
    e.RowBounds.Location.Y,
    kryptonDataGridView_sublstsfc.RowHeadersWidth - 4,
    e.RowBounds.Height);

    TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
    kryptonDataGridView_sublstsfc.RowHeadersDefaultCellStyle.Font,
    rectangle,
    kryptonDataGridView_sublstsfc.RowHeadersDefaultCellStyle.ForeColor,
    TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
    }

    快乐而轻松的写代码
  • 相关阅读:
    Java实现分页
    研发技能列表
    shell 函数
    养生
    再谈创新
    写代码注意事项
    排查问题方法
    简历撰写
    jenkins
    架构
  • 原文地址:https://www.cnblogs.com/libei/p/6518585.html
Copyright © 2011-2022 走看看