dbgrideh 的 onDrawColumnCell 事件中键入以下代码:<br> //定义网格线的颜色: <br> dbgrideh1.DefaultDrawColumnCell(Rect,DataCol,Column,State); <br> with (Sender as Tdbgrideh ).Canvas do //画 cell 的边框 <br> begin <br> Pen.Color := $00ff0000; //定义画笔颜色(蓝色) <br> MoveTo(Rect.Left, Rect.Bottom); //画笔定位 <br> LineTo(Rect.Right, Rect.Bottom); //画蓝色的横线 <br> Pen.Color := $0000ff00; //定义画笔颜色(绿色) <br> MoveTo(Rect.Right, Rect.Top); //画笔定位 <br> LineTo(Rect.Right, Rect.Bottom); //画绿色的竖线 <br> end; <br> end;