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

TppMemo height?

edited February 2002 in General
When you place a TppLabel on a band, it will at design time automatically
take the appropriate height for the current font...but a TppMemo will not.

I need to know the height of a stretchable TppMemo the same way...at user's
design time.

I am considering to programatically place a temporary TppLabel, read it's
height, and multiply this with the number of lines in the TppMemo...but is
there a more simple approach?

--

Mvh/regards
Svein Olav Mytting
Intelligent Software AS
Bogstadvn 60A, 0366 Oslo
www.IntelligentSoftware.no

Comments

  • edited February 2002
    var
    lMemo: TppMemo;
    lBitmap: TBitmap;
    liTexHeight: Integer;
    begin

    lMemo:= TppMemo(aComponent);

    lBitmap := TBitmap.Create;

    lBitmap.Canvas.Font := lMemo.Font;

    liTextHeight := lBitmap.Canvas.TextHeight('W');

    lBitmap.Free;

    lMemo.spHeight := liTextHeight * {YourNumberOfLinesHere};

    end;

    That's at least one way to do it...

    --
    Tom Ollar
    Digital Metaphors Corporation
This discussion has been closed.