datagridcolorcolumnstyle.cs
来自「一个通用的数据库访问层」· CS 代码 · 共 53 行
CS
53 行
using System;
using System.Windows.Forms;
namespace YariSoft.Windows.Conrols
{
public delegate void OnDataGridColumnPainEventHandler
( ref System.Drawing.Graphics g,
ref System.Drawing.Rectangle bounds,
ref System.Windows.Forms.CurrencyManager source,
ref int rowNum,
ref System.Drawing.Brush backBrush,
ref System.Drawing.Brush foreBrush,
ref bool alignToRight);
public class YDataGridColorTextBoxColumn : DataGridTextBoxColumn
{
public event OnDataGridColumnPainEventHandler OnPaint = null;
protected override void Paint( System.Drawing.Graphics g,
System.Drawing.Rectangle bounds,
System.Windows.Forms.CurrencyManager source,
int rowNum,
System.Drawing.Brush backBrush,
System.Drawing.Brush foreBrush,
bool alignToRight )
{
if( this.OnPaint != null ){
this.OnPaint( ref g, ref bounds, ref source, ref rowNum, ref backBrush, ref foreBrush, ref alignToRight );
}
base.Paint( g, bounds, source, rowNum, backBrush, foreBrush, alignToRight );
}
}
public class YDataGridColorBoolBoxColumn : DataGridBoolColumn
{
public event OnDataGridColumnPainEventHandler OnPaint = null;
protected override void Paint( System.Drawing.Graphics g,
System.Drawing.Rectangle bounds,
System.Windows.Forms.CurrencyManager source,
int rowNum,
System.Drawing.Brush backBrush,
System.Drawing.Brush foreBrush,
bool alignToRight )
{
if( this.OnPaint != null ){
this.OnPaint( ref g, ref bounds, ref source, ref rowNum, ref backBrush, ref foreBrush, ref alignToRight );
}
base.Paint( g, bounds, source, rowNum, backBrush, foreBrush, alignToRight );
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?