I would like to adjust the TPanel height, just enough, to show all text in AtSynEdit, without any extra blank space at bottom.
So, I need to figure out total height of TAtSynEdit Text, even if it's Wrapped...
Here's what I have so far, but, not able to get the right calculation:
Code: Select all
procedure AdjustPanelHeightToShowAllText;
var LineCount: Integer;
begin
Syn.Text:=Trim(Syn.Text);
// LineCount:=Syn.Strings.Count; { Better Get Count from Next Line? }
LineCount:=Syn.WrapInfo.Count; //-1;
Panel.Height:=Abs(Syn.Font.Height) * LineCount;
end;
Thank You Sincerely.