http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q745q
http://expert.csdn.net/Expert/topic/1550/1550919.xml?temp=.4747583
http://expert.csdn.net/Expert/topic/1550/1550919.xml?temp=.4747583
解决方案 »
- C#的程式窗體與何中文化
- 在aspx.net中调用.exe文件
- 谁有《C#入门经典》的源代码??
- dataGrid中的单元格好难操作?
- 多表数据的查询 在同一个datalist显示所有字段数据记录!
- 微软的vs2005产品发布会已经发布vs2005,将在近期推出。
- BackgroundWorker, RunWorkerCompleted事件疑问
- SqlDataReader.GetFloat(int i)抛掷异常!!有点打击我的小问题!!!!!!!
- 除了system.web.mail可以发邮件外,c#还有什么方法可以收发邮件啊???
- 在C#如何实现键盘HOOK,请举例说明。
- 结束线程??????
- 关于数据库连接的问题!!!谢谢!!!!
dtGrid商品.BackColor = Color.Blue;
public class DataGridColoredTextBoxColumn : DataGridTextBoxColumn
{
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)
{
// the idea is to conditionally set the foreBrush and/or backbrush
// depending upon some crireria on the cell value
// Here, we color anything that begins with a letter higher than 'F'
try{
object o = this.GetColumnValueAtRow(source, rowNum);
if( o!= null)
{
char c = ((string)o)[0];
if( c > 'F')
{
// could be as simple as
// backBrush = new SolidBrush(Color.Pink);
// or something fancier...
backBrush = new LinearGradientBrush(bounds,
Color.FromArgb(255, 200, 200),
Color.FromArgb(128, 20, 20),
LinearGradientMode.BackwardDiagonal);
foreBrush = new SolidBrush(Color.White);
}
}
}
catch(Exception ex){ /* empty catch */ }
finally{
// make sure the base class gets called to do the drawing with
// the possibly changed brushes
base.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight);
}
}
}