好,我给你答案
对stringGrid来说
修改grids中TCustomGrid的paint函数
主要是下面两句
DrawEdge(Canvas.Handle, TempRect, BDR_RAISEDINNER, FrameFlags1);
DrawEdge(Canvas.Handle, TempRect, BDR_RAISEDINNER, FrameFlags2);
具体的说明可以查msdn
给你一个我在别的空间中修改grid的例子
FrameFlags1 := BF_BOTTOM or BF_RIGHT;
FrameFlags2 := BF_TOP or BF_LEFT;
if DefaultDrawing and (gdTitled in DrawState) and Ctl3D then
begin
Ctl3DRect := Where;
Case FGridStyle of
GSUltraFlat:
begin
DrawEdge(Canvas.Handle, Ctl3DRect, BDR_RAISEDINNER, BF_FLAT);
DrawEdge(Canvas.Handle, Ctl3DRect, BDR_RAISEDINNER, BF_FLAT);
end;
GSFlat:
begin
Ctl3DRect.Right:=Ctl3DRect.Right+1;
Ctl3DRect.Bottom:=Ctl3DRect.Bottom+1;
DrawEdge(Canvas.Handle, Ctl3DRect, BDR_RAISEDINNER, BF_RECT );
end;
GSStand:
begin
DrawEdge(Canvas.Handle, Ctl3DRect, BDR_RAISEDINNER, FrameFlags1);
DrawEdge(Canvas.Handle, Ctl3DRect, BDR_RAISEDINNER, FrameFlags2);
end;
end;