Cells[1,0]:=’AA这是列合并BB’;
Cells[0,1]:=’A这是行’#10’合并BB’;
Cells[1,1]:=’1111111’;
Cells[1,2]:=’1111222’;
Cells[2,1]:=’2222111’;
Cells[2,2]:=’2222222’;
end;
end;
//重载 OnDrawCell 事件
procedure TForm1.SGDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
r:TRect;
d:TStringGrid;
s:string;
ts:TStrings;
i,n:integer;
fixed:Boolean;
begin
d:=TStringGrid(sender);
if (Acol=2) and (ARow=0) then
begin
r.left:=Rect.left-1-d.colwidths[ACol-1];
r.top:=rect.top-1;
r.right:=rect.right;
r.bottom:=rect.bottom;
s:=d.cells[ACol-1,ARow];
end else
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/