zoukankan      html  css  js  c++  java
  • WinForm DataGridView 显示行号

            private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
            {
                Rectangle rectangle = new Rectangle(e.RowBounds.Location.X,
                    e.RowBounds.Location.Y,
                    dataGridView1.RowHeadersWidth,
                    e.RowBounds.Height);

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

  • 相关阅读:
    Android控制软键盘的现实与隐藏
    Android调用手机浏览器
    DatePicker隐藏年/月/日
    ecplise中设置字符编码
    Git问题总结
    Git的简单使用
    资源
    equals和==
    class文件查看
    Class file collision
  • 原文地址:https://www.cnblogs.com/zhangpengshou/p/1330127.html
Copyright © 2011-2022 走看看