Shape Color
Hi,
I need to change the background color on a shape in a subreprt.
I have tried with the DBText.OnPrint event
if DBText22.FieldValue < 0 then
Shape4.Brush.Color := clRed;
if DBText22.FieldValue > 0 then
Shape4.Brush.Color := clWhite;
But all shapes in the subreports is colored red.
Any ideas?
/Ronny
I need to change the background color on a shape in a subreprt.
I have tried with the DBText.OnPrint event
if DBText22.FieldValue < 0 then
Shape4.Brush.Color := clRed;
if DBText22.FieldValue > 0 then
Shape4.Brush.Color := clWhite;
But all shapes in the subreports is colored red.
Any ideas?
/Ronny
This discussion has been closed.
Comments
OnPrint. Also, set the Brush.Style value. e.g.:
procedure TForm1.ppShape1Print(Sender: TObject);
begin
if ppDBText1.FieldValue < 0 then
begin
ppShape1.Brush.Color := clRed;
ppShape1.Brush.Style := bsSolid;
end
else
ppShape1.Brush.Style := bsClear;
end;
--
Ed Dressel
Team DM
Works fine, thanks.
The red color was to dark when printed, any way of setting it to light
red?
/Ronny
It is possible to set the color of an object to a corresponding hexidecimal
RGB value as well as the built in color types. For instance you could
change the line setting the brush color to clRed to:
ppShape1.Brush.Color := $004040FF;
This should give you a somewhat lighter red. See TColor type in the Delphi
help for more information.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com