刚做了个成绩单
刚学DELPHI,做了一个成绩单,不过文字不会居中。哪位大侠赐教! 标题不会居中也要售1鱼币?我帮你解决procedure TForm1.TableDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
const
AlignFlags:array of integer=
(DT_LEFT oR DT_VCENTER OR DT_WORDBREAK OR DT_EXPANDTABS OR DT_NOPREFIX,
DT_RIGHT OR DT_VCENTER OR DT_WORDBREAK OR DT_EXPANDTABS OR DT_NOPREFIX,
DT_CENTER OR DT_VCENTER OR DT_WORDBREAK OR DT_EXPANDTABS OR DT_NOPREFIX);
var
s:string;
begin
inherited;
with Rect do
begin
left:=left+2;
top:=top+2;
Right:=right-5;
end;
s:=Table.Cells;
if ((acol=0) and (arow<=table.RowCount)) or ((acol<=table.ColCount) and (arow=0)) then
begin
Table.Canvas.Font.Style:=Table.Canvas.Font.Style+;
Table.Canvas.Brush.Color:=Table.FixedColor;
Table.Canvas.FillRect(rect);
Drawtext(Table.Canvas.Handle,pchar(s),length(s),rect,AlignFlags);
end
else
//if (acol=0 ) and (arow> 0) and (arow < Table.RowCount) then
begin
Table.Canvas.FillRect(rect);
Drawtext(Table.Canvas.Handle,PChar(s),length(s),Rect,AlignFlags);
end; z这还要钱啊 让赐教你的人拿钱给你:lol
页:
[1]