(1) Different color settings; written in DBGRIDEH1DRAWCOLUMNCELL;
IF adoquery1.recno mod 2 = 0 THEN
Begin
DBGRIDEH1.CANVAS.
Font.color: = CLRED;
DBGRIDEH1.DEFAULTDRAWCOLUMNCELL (Rect, Datacol, Column, State);
end
Else Begin
DBGRIDEH1.CANVAS.
Font.color: = CLGREEN
DBGRIDEH1.DEFAULTDRAWCOLUMNCELL (Rect, Datacol, Column, State);
END;
(2) Branch different background color settings; written in DBGRIDEH1DRAWCOLUMNCELL;
IF adoquery1.recno mod 2 = 0 THEN
Begin
DBGRIDEH1.CANVAS.
Brush.color: = CLRED;
DBGRIDEH1.DEFAULTDRAWCOLUMNCELL (Rect, Datacol, Column, State);
end
Else Begin
DBGRIDEH1.CANVAS.
Brush.color: = clgreen;
DBGRIDEH1.DEFAULTDRAWCOLUMNCELL (Rect, Datacol, Column, State);
END;
(3) Eligible cell color or background color setting; written in DBGRIDEH1DRAWCOLUMNCELL;
IF
Column.fieldName = 'price' Then
Begin
IF
AdoQuery1.fieldbyName ('price') .asfloat <0 THEN
Begin
DBGRIDEH1.CANVAS.FONT.COLOR: = CLRED;
DBGRIDEH1.DEFAULTDRAWCOLUMNCELL (Rect, Datacol, Column, State);
END;
END;