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

Getting the Height of a TppMemo that stretches

edited June 2003 in General
Hi,

I was wondering if there is a way to get the height of a TppMemo after you
have added some text?

The problem I have is that a report that populates 3 memos which need to be
keep in sync. If I add data to one memo I need to add an empty string to the
other 2 memo's to keep them horizontally correct. The issue arises when the
data added to one memo wraps onto a second line and therefore the other 2
memos get out of sync.

I was thinking of doing something like

function (Memo1,Memo2, Memo3: TppMemo): Integer;
{return the index of the memo that has a different height}
var
.....
begin
Get Height of Memo1, Memo2, Memo3
Campare Memo heights
if all the same result = 0 else result = Memo that has a different height
end;

The problem Line count is no good because 1 lines can wrap on 3 lines
possible and Height parameter doesn't change after each Memo.Line.Add. Any
suggestions are extremely welcome.

Cheers
Stuart

Comments

  • edited June 2003
    Stuart,

    Why do you need to find the height of a TppMemo? Check out the BottomOffset
    and ShiftRelativeTo properties and see if they can help you before trying to
    obtain the memo height information.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.