procedure TfrmMain.sgStatusCounterDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
With Sender as TStringGrid do
begin
if cells[3, ARow] <> '' then
begin
if IsNumeric(cells[3, ARow]) then
begin
if StrToInt(cells[3, ARow]) >= 90 then
begin
//for BackGround Color
Canvas.Brush.Color := clRed;
Canvas.FillRect(Rect);
//for Font.Color
Canvas.Font.Color := clBlack;
Canvas.TextRect( Rect, Rect.Left+2, Rect.Top+2, Cells[acol, arow]);
end
else if (StrToInt(cells[3, ARow]) >= 85) and (StrToInt(cells[3, ARow]) <= 89) then
begin
//for BackGround Color
Canvas.Brush.Color := clYellow;
Canvas.FillRect(Rect);
//for Font.Color
Canvas.Font.Color := clBlack;
Canvas.TextRect( Rect, Rect.Left+2, Rect.Top+2, Cells[acol, arow]);
end
else if (StrToInt(cells[3, ARow]) > 80) and (StrToInt(cells[3, ARow]) < 85) then
begin
//for BackGround Color
Canvas.Brush.Color := clSkyBlue;
Canvas.FillRect(Rect);
//for Font.Color
Canvas.Font.Color := clBlack;
Canvas.TextRect( Rect, Rect.Left+2, Rect.Top+2, Cells[acol, arow]);
end;
end;
end;
end;
end;