请问StringGrid的多表头的问题
在StringGrid中的多表头如何显示,我override了DrawCell,可一旦按了 滚动条,就不能正常显示,代码如下:
procedure TCourseGrid.Drawcell(......);
var
rLeft,rRight,rTitle:TRect;
outstr:string;
i:integer;
begin
inherited drawcell(...)
if ACol=0 then
for i:=1 to 7 do
begin
case i of
1:outstr:='字符串一';
2:outstr:='字符串二';
3:outstr:='字符串三';
4:outstr:='字符串四';
5:outstr:='字符串五';
6:outstr:='字符串六';
7:outstr:='字符串日';
end;
rLeft:=Cellrect((i-1)*FDayHourCount+1,0);
rRight:=cellrect(i*FDayHourCount,0);
rTitle.TopLeft:=rLeft.TopLeft;
rTitle.BottomRight:=rRight.BottomRight;
Canvas.FillRect(rTitle);
drawText(Canvas.Handle,pchar(outstr),length(outstr),rTitle,dt_center);
end;
end;