在TGrid的一排的背景颜色

时间:2013-12-23 21:19:45

标签: delphi firemonkey delphi-xe4 delphi-xe5

几乎让Mike的解决方案与tgrid的操作一起工作。我唯一想知道的是如何在ApplyStyling程序中设置背景?

Procedure TFinanicalCell.ApplyStyling;
begin
  FontColor:= claBlue;
  Font.Size:= 18;
  // Background ?
    if Assigned(Font.OnChanged) then
      Font.OnChange(Font);
      Repaint;
end;

我也想知道为什么我的setData程序中的值为0?

Procedure TFinancialCell.SetData(const Value: TValue);
var
 F: Single;
begin

  F := Value.Astype<single>;
  inherited SetData(Format('%m',[F]));

end;

我的GetValue程序:

procedure TForm5.Grid1GetValue(Sender: TObject; const Col, Row: Integer; var Value: TValue);
 begin
   if Col = 0 then
    Value := Row
   else if Col = 1 then
   begin
    Value := FloatToStr(Data[Row]);
    if Data[Row] >30 then
    begin
     Value := '#' + FloatToStr(Data[Row]);
    end;
   end;
 end;

0 个答案:

没有答案
相关问题