Change ppmemo color on input value
?I would like color of the ppmemo to change according to the value of
the input, ie for values 0-4, color = clGreen, for values 5-10, color =
clRed.
I have gotten this to work with shapes, but not with ppmemo's.
Thank you.
--- posted by geoForum on http://delphi.newswhat.com
the input, ie for values 0-4, color = clGreen, for values 5-10, color =
clRed.
I have gotten this to work with shapes, but not with ppmemo's.
Thank you.
--- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.
Comments
1. Be sure you have the Transparent property of the memo set to False.
2. Use the TppMemo.Color to alter the background color of the memo
component.
ppMemo1.Transparent := False;
ppMemo1.Color := clGreem;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thank you, it worked very well!
Regards,
Daneel
=
--- posted by geoForum on http://delphi.newswhat.com
here is what I did:
procedure ppMemo19OnPrint;
begin
if ppMemo19.lines.text = '5' then
ppMemo19.Transparent := False;
ppMemo19.Color := clRed;
end;
end;
Thank you.
--- posted by geoForum on http://delphi.newswhat.com
Try using the Band.BeforePrint event to set the color of the Memo. Also,
note that you will need to set the color back to the default if the
condition is not met so other memos will not remain the changed color.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
please see if you can spot it, error tells me:
'Line5: Expected 'not' or 'or' but found 'ppMemo19' instead
procedure DetailBeforePrint;
begin
if ppMemo19.lines.text = '5' then
ppMemo19.Transparent := False
ppMemo19.Color := clRed;
else
ppMemo19.Color := clWhite;
end;
end;
Thank you
Regards,
Daneel
--- posted by geoForum on http://delphi.newswhat.com
procedure DetailBeforePrint;
begin
if ppMemo19.lines.text = '5' then
begin
ppMemo19.Transparent := False;
ppMemo19.Color := clRed;
end
else
ppMemo19.Color := clWhite;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com