Page 1 of 1
Sizing

Posted:
25 Aug 2014 12:01
by etwoss
Hi
I Have a labelEx where if fill TextEx.Text
As you can see the text is ok, sizing goes ok, but i want to keep my Button after the text.
The height value is not jet known at server time
Eric
Re: Sizing

Posted:
26 Aug 2014 08:17
by etwoss
Hi
Tried to achieve it using two region in one, where the first region contains the LabelEx and the Second one the button.
Still i have to 'calculated' the complete height of the Frame to give the LabelEx the space to expand. If the height is not enough , it 'overwrites' the second one with the button.
Eric
Re: Sizing

Posted:
26 Aug 2014 08:55
by etwoss
Hi
Found some solution now, also with two regions in one, but having the first region "ClipRegion" is True
So now i can scroll the text of the label in that region and the button always is at the bottom of the text
One problem still, can't get a Vertical scrollbar for the region of the LabelEx
Eric
Re: Sizing

Posted:
26 Aug 2014 09:39
by Alexander Bulei
Hi Eric,
One problem still, can't get a Vertical scrollbar for the region of the LabelEx
property CGScrollStyle?
Best Regards.
Re: Sizing

Posted:
26 Aug 2014 09:54
by etwoss
Hi
Solved it this way:
CGScrollStyle of the LabelEx is set to cgsbsVerticalAuto
- Code: Select all
var
S : TStringList;
begin
S := TStringList.Create;
try
s.CommaText := Value;
Height := 25 + Round(S.Count * 14.6); // calculate a little bit what the size could be
if (Height > 400) then // max size of 400
Height := 400;
IWCGJQLabelQuestionDescription.Height := Height - IWCGJQRegionBottom.Height - 10; // recalculate the height of the Label
IWCGJQLabelQuestionDescription.AutoSize := True; // Now set AutoSize to true
finally
FreeAndNil(s);
end;
IWCGJQLabelQuestionDescription.TextEx.Text :=
StringReplace(Value, ''#$D#$A'', '<BR>', [rfReplaceAll]);
Re: Sizing

Posted:
26 Aug 2014 09:56
by Alexander Bulei
Hi Eric,
Thanks for sharing the solution

BR