Estou usando esta rotina para tentar pintar valores negativos no DBgrid do Lazarus que deve ser parecido com com Delphi,
mas estou recebendo um erro no valor de canvas:
DBGrid1.Canvas.Font.Color:= clRed; O Lazarus não reconhece a constante clRed
procedure Tform1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
BEGIN
if (Column.Field.FieldName = 'campovalor') then
begin
if (Dtm.ZQuery1.FieldByName('campoValor').Value < 0) then
begin
DBGrid1.Canvas.Font.Color:= clRed;
end
else
DBGrid1.Canvas.Font.Color:= clWindowText;
DBGrid1.Canvas.FillRect(Rect);
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
END;
ERRO: form1.pas Error: Identifier not found "clRed"
Question
Lazaruz 0
Olá!!
Estou usando esta rotina para tentar pintar valores negativos no DBgrid do Lazarus que deve ser parecido com com Delphi,
mas estou recebendo um erro no valor de canvas:
DBGrid1.Canvas.Font.Color:= clRed; O Lazarus não reconhece a constante clRed
procedure Tform1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
BEGIN
if (Column.Field.FieldName = 'campovalor') then
begin
if (Dtm.ZQuery1.FieldByName('campoValor').Value < 0) then
begin
DBGrid1.Canvas.Font.Color:= clRed;
end
else
DBGrid1.Canvas.Font.Color:= clWindowText;
DBGrid1.Canvas.FillRect(Rect);
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
END;
ERRO: form1.pas Error: Identifier not found "clRed"
alguém poderia me auxiliar por gentileza?! grato.
Link to post
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.