Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

Objects added to TVertScrollbox - problem in scrolling

$
0
0

I'm using a TVertScrollBox and i add some objects from code (TFrame with a Layout and three Label inside). The objects appear correctly, but when I move the scroller, the position of some labels, font size and bold status change in a random way. This happens in the same manner on Win32 and on Android.
The problem doesn't appear if i add manually (but is unuseful for my application) the Frames with the designer, inside the ide.
Someone can help me? Where is my mistake?
Thank you
Fabio


A fragment of my code, used for test. I assign Parent property of the Frame to the VertScrollBox. I have tryed the InsertComponent method too, but with no result.

...
arr : array[0..50] of TFrameValue;


...
procedure TForm1.FormShow(Sender: TObject);
var
  i : integer;
begin
  VertScrollBox1.BeginUpdate;
  for i := 0 to 20 do
    begin
      arr[i] := TFrameValue.Create(nil);
      arr[i].Parent := VertScrollBox1;
      arr[i].Name := Format('frame%d',[i]);
      arr[i].Align := TAlignLayout.Top;
      //VertScrollBox1.InsertComponent(arr[i]);
    end;
  VertScrollBox1.EndUpdate;
end;


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>