TppMemo height?
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
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
This discussion has been closed.
Comments
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
http://www.digital-metaphors.com
info@digital-metaphors.com