01-09-2021, 04:36 PM
(This post was last modified: 01-09-2021, 04:42 PM by Сергей Александрович.)
Below is the procedure for processing the onRendercell event of the dgMessage component (TIWDBGrid).
Problem:
ACell.BGColor := clWebLIGHTBLUE - works,
ACell.Font.Color := clWebGreen; does not work.
The background color changes, but the text color does not change.
procedure TfmVmMain.dgMessageRenderCell(ACell: TIWGridCell; const ARow,
AColumn: Integer);
begin
with dmVM do
begin
case dmVM.mtMessage.FieldByName('TYPE_REC').AsInteger of dmVM.mtMessage.Fieldbyname ('TYPE_REC').AsInteger of
0 : ACell.Font.Color := clWebBLACK;
1 : ACell.Font.Color := clWebNavy; // TextFont.Цвет: = clWebNavy; / / текст
2 : ACell.Font.Color := clWebGreen; // Header 1Font.Цвет := clWebGreen; / / Заголовок 1
3 : ACell.Font.Color := clWebMaroon; // Header 2Font.Color := clWebMaroon; / / Заголовок 2
end;
if dgMessage.RowIsCurrent then
begin
mCurrentMID := mtMessage.FieldByName('MID').AsString;
ACell.BGColor := clWebLIGHTBLUE;//clWebWHITE;
end else begin
ACell.BGColor := clWebGAINSBORO;// clMoneyGreen;// clWebWHITE;
end;
end;
end;
Tell me what is wrong?
Problem:
ACell.BGColor := clWebLIGHTBLUE - works,
ACell.Font.Color := clWebGreen; does not work.
The background color changes, but the text color does not change.
procedure TfmVmMain.dgMessageRenderCell(ACell: TIWGridCell; const ARow,
AColumn: Integer);
begin
with dmVM do
begin
case dmVM.mtMessage.FieldByName('TYPE_REC').AsInteger of dmVM.mtMessage.Fieldbyname ('TYPE_REC').AsInteger of
0 : ACell.Font.Color := clWebBLACK;
1 : ACell.Font.Color := clWebNavy; // TextFont.Цвет: = clWebNavy; / / текст
2 : ACell.Font.Color := clWebGreen; // Header 1Font.Цвет := clWebGreen; / / Заголовок 1
3 : ACell.Font.Color := clWebMaroon; // Header 2Font.Color := clWebMaroon; / / Заголовок 2
end;
if dgMessage.RowIsCurrent then
begin
mCurrentMID := mtMessage.FieldByName('MID').AsString;
ACell.BGColor := clWebLIGHTBLUE;//clWebWHITE;
end else begin
ACell.BGColor := clWebGAINSBORO;// clMoneyGreen;// clWebWHITE;
end;
end;
end;
Tell me what is wrong?