DataGridView中添加行号
来源:互联网 发布:qt交叉编译ubuntu下 编辑:程序博客网 时间:2024/06/06 05:36
private void DGV_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
DataGridView dt = sender as DataGridView;
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dt.RowHeadersWidth - 4,
e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
dt.RowHeadersDefaultCellStyle.Font,
rectangle,
dt.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
{
DataGridView dt = sender as DataGridView;
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dt.RowHeadersWidth - 4,
e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
dt.RowHeadersDefaultCellStyle.Font,
rectangle,
dt.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}
DGV.RowPostPaint += new DataGridViewRowPostPaintEventHandler(DGV_RowPostPaint);
0 0
- DataGridView中添加行号
- 在DataGridView中添加行号
- 在DataGridView中添加行号
- c# 在DataGridView中添加行号
- dataGridView添加行号
- DataGridView添加行号
- 为datagridView添加行号
- 为DataGridView添加行号
- vs2005 DataGridView添加行号
- DataGridView添加行号
- DataGridView添加行号
- datagridview添加行号
- dataGridView添加行号
- DataGridView添加行号
- C#的DataGridView中自动在行首添加行号
- datagridview中显示行号
- C#----给DataGridView添加行号
- Winform中的DataGridView添加行号
- Android M 6.0以上 需要运行时申请的权限
- 解决:XP系统sfc /scannow RPC不可用 错误 0x000006ba
- 前后端交互之MVC模式初探
- mysql之加锁处理分析
- 理想互联网金融p2p平台特性
- DataGridView中添加行号
- 目录
- 分布式系统的事务处理经典问题及模型
- iOS APP开发集成Apple Pay与银联SDK开发教程(附示例代码)
- java.sql.Date 日期 加减天数的实现
- 在Windows下安装pinpoint并关联自己的服务(tomcat)
- static静态代码块与非静态代码块 + 构造函数
- bash: arm-linux-gcc: No such file or directory
- RxJava 入门引导