Winform datagridview画斜线表头
来源:互联网 发布:数学建模含金量 知乎 编辑:程序博客网 时间:2024/04/29 02:15
/// <summary>
/// 画斜线表头
/// </summary>
/// <param name="e"></param>
/// <param name="type"></param>
/// <param name="name1"></param>
/// <param name="name2"></param>
void PaintLine(DataGridViewCellPaintingEventArgs e, string type, string name1, string name2)
{
if ((type == "1" && e.ColumnIndex == 1 && e.RowIndex == -1) || (e.ColumnIndex == 0 && e.RowIndex == -1 && type == "2"))
{
Graphics gp = e.Graphics;
Rectangle rec = e.CellBounds;
Brush gridBrush = new SolidBrush(Color.FromArgb(208, 215, 229));
Pen gridLinePen = new Pen(gridBrush);
gp.DrawLine(gridLinePen, new Point(rec.X, rec.Y), new Point(rec.X + rec.Width, rec.Y + rec.Height));
float x = 55;
if (type == "1")
x = x + 30;
gp.DrawString(name1, e.CellStyle.Font, Brushes.Black, new PointF(rec.X + 12, rec.Y + 22));
gp.DrawString(name2, e.CellStyle.Font, Brushes.Black, new PointF(rec.X + x, rec.Y + 5));
}
}
- Winform datagridview画斜线表头
- winForm datagridview 表头处理
- [WinForm]Datagridview 实现二维表头
- winform datagridview 表头加全选
- 斜线表头
- 在EXCEL 2010里画斜线(斜线表头)
- 禁止DataGridView点击表头进行排序(WinForm)
- C#WINFORM 的DATAGRIDVIEW多表头实现
- .NET Winform Datagridview 实现多行表头
- html 表格表头画一条斜线
- Word 表头 斜线
- Word2003表格 斜线表头
- Excel插入斜线表头
- 表格-表头有斜线
- table表头斜线
- net WinForm DataGridView 多表头处理方案一则
- .net WinForm DataGridView 多表头处理方案一则
- winform 中 给DataGridView的表头添加CheckBox
- 双向循环链表实现字符串或int类型数组的左移或右移操作C++
- Linux内核中断相关的数据结构 (三)
- C++内存管理之一(检测内存泄露)
- Android开源代码解读-基于SackOfViewAdapter类实现类似状态通知栏的布局
- ios 下拉刷新
- Winform datagridview画斜线表头
- java ant build
- 薄荷花开
- sql server 连接服务器 同义词 笔记
- 文章收藏
- Gstreamer 工具使用 (一)
- 慎用JavaScript深复制!(js deepClone)
- 学习笔记之SOCKET网络编程
- 堆排序小优化