我在 Delphi Firemonkey XE7 中为一个应用程序创建了一个 Stringgrid,并用我的 MySQL 数据库中的数据填充它。为了放大字体大小,我使用了以下代码:
procedure TFormSearchRecipient.sgRecipientDrawColumnCell(Sender: TObject;
const Canvas: TCanvas; const Column: TColumn; const Bounds: TRectF;
const Row: Integer; const Value: TValue; const State: TGridDrawStates);
var b : TRectF; border: integer;
begin
//following leaves in the end a border so that the marked item can be seen
b := bounds;
border:= 2;
b.Top := b.Top + border;
b.Left := b.Left - border;
b.Height := b.Height - 2 * border;
b.Width := b.Width - 2 * border;
//colors the background white so that the data cannot be seen anymore
Canvas.Fill.Color := TAlphaColorRec.White;
Canvas.FillRect(b, 0, 0, [], 1);
//change the canvas text options
Canvas.Fill.Color := TAlphaColorRec.Black;
Canvas.Font.Size := 25;
//write the content
Canvas.FillText(Bounds, Value.AsString , False, 1, [] , TTextAlign.Leading);
end;
我希望你们中的一些人能理解这段代码的作用......这张图片可能会有所帮助。
我现在的问题是:如何设置标题以及如何放大标题的字体大小,或者 - 如果不可能 - 我如何禁用、删除或隐藏标题?
提前致谢!
问候莉亚