Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Change a TppDrawCommand Font Color

edited December 2006 in General
Hi...

i'm wondering about how can i change the font of a specific drawcommand
object in my report, well here is the case:

i have a TppDBText with a OnDrawCommandClick event assigned, in this event
i show a little message; that works great, but i want to mark that
DrawCommand as "visited", like if i was working with a hyperlink, changing
the font color of the object clicked...

How can i change the color of the object and just that object, better if
whitout have to redraw the entire report for this simple action.

Any help or ideas will be very helpfull :)

Thanx

Comments

  • edited December 2006
    Hi Carlos,

    It is not possible to change a single report component from the preview
    window. You will need to redraw the page you are viewing to show any
    changes made. You can use the TppDrawCommand.RedrawPage property to redraw
    a page at runtime. In my testing, the following code gave the effect you
    were after...

    procedure TForm1.ppLabel1DrawCommandClick(Sender, aDrawCommand: TObject);
    begin
    FVisited := True;
    TppDrawText(aDrawCommand).RedrawPage := True;

    end;

    procedure TForm1.ppLabel1DrawCommandCreate(Sender, aDrawCommand: TObject);
    begin
    if FVisited then
    TppDrawText(aDrawCommand).Font.Color := clRed;
    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2006

    Thanx Nico, Works Great!!!!
This discussion has been closed.