Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7884057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:41:53+00:00 2026-06-03T04:41:53+00:00

In my application i work with TLabel objects runtime. There is a problem: representing

  • 0

In my application i work with TLabel objects runtime.

There is a problem: representing a 20 labels takes a lot time (about a 1-2 second).

DoubleBuffered on parent component doesn’t help. Application.ProcessMessages only allows watching for a proccess of creating, instead of looking at frosen window.

// creating a labels in loop 
aLabel:=TLabel.Create(scrlbx);
labels.Add(aLabel); // TList for managing.
with aLabel do begin
Left:=pointLeft;
    Top:=pointTop;
    Caption:='title';
    parent:=scrlbx; //TScrollBox
end;
pointTop:=pointTop+20;

Taking parent assigning out of loop to another loop after does some effect, but does’n solve the problem.

for I := 0 to labels.Count-1 do begin
    TLabel(labels[i]).Parent:= scrlbx;
end;

Disable and enable TScrollBox.Visible before and aftel loops has no effect.

PS:
Creting of objects doesn’t takes a time.
The bottleneck is parent assigning.

upd: large amount means about 500 items..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:41:54+00:00Added an answer on June 3, 2026 at 4:41 am

    Use ScrollBox.DisableAlign and .EnabledAlign.

    procedure TForm1.CreateLabels2;
    var
      I: Integer;
      ALabel: TLabel;
      ATop: Integer;
    begin
      ATop := 0;
      ScrollBox2.DisableAlign;
      for I := 0 to 2000 do
      begin
        ALabel := TLabel.Create(ScrollBox2);
        FLabels.Add(ALabel);
        with ALabel do
        begin
          Caption := 'Title';
          SetBounds(0, ATop, Width, Height);
          Parent := ScrollBox2;
        end;
        Inc(ATop, 20);
      end;
      ScrollBox2.EnableAlign;
    end;
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Every time I open my Terminal application at work it starts from a clean
I am currently developing an application to work with WAV files. I want to
I'm just writing a test application to work out how I can optimise searching
I'm trying to get a CakePHP application to work. For this, I've set up
We are using Ext JS for an application in work, building a custom theme
I have a WCF service and a Silverlight application that work just fine when
I am a student programmer using QT to develop and application for work. Currently
I'm currently working on my first MVC3 application at work (using the Razor view
I'm updating code in an old Java application at work but I'm pretty new
I'm trying to get the browser function in my Android application to work but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.