Set Height of TDBText-Field
Hi,
within the detailband I have a region.
On this region is a Memofield and a DBText-Field.
The memo can have one or more rows. The region does stretch with the
memo.
How can I set the height of the DBText-Field exactly the height of the
stretching region?
Thanks for your help,
Josef Gschwendtner
--
within the detailband I have a region.
On this region is a Memofield and a DBText-Field.
The memo can have one or more rows. The region does stretch with the
memo.
How can I set the height of the DBText-Field exactly the height of the
stretching region?
Thanks for your help,
Josef Gschwendtner
--
This discussion has been closed.
Comments
The DBText component is not stretchable so it will not automatically size
itself vertically. Depending on what you are trying to accomplish, you
could measure the height of the text inside the memo object before the
DBText object is created and set it's height accordingly. Another option
would be to use two regions and have the region with the DBText set to
StretchWithParent.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Yes that is what I did like to do, but I don't find an appropriate
event and/or technique to do this.
Could you give me a hint.
Josef
--
Rather than measure, try using the OnDrawCommandCreate event to determine
the final height of the memo. Something like the following...
uses
ppDrwCmd, ppUtils;
procedure TForm1.ppMemo1DrawCommandCreate(Sender, aDrawCommand: TObject);
var
lDrawText: TppDrawText;
lMemoHeight: Double;
begin
lDrawText := TppDrawText(aDrawCommand);
lMemoHeight := ppFromMMThousandths(lDrawText.Height, utInches,
pprtVertical, nil);
ppDBText1.Height := lMemoHeight;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com