2

I'm using TScrollBox to make custom list contains many controls (Tlabels,Timages,Tshapes)

the problem is when i use TPanels as a container for each Item the list getting slow and flickery after adding about 100 items.

i'm looking for an alternative to TPanel based on TGraphicControl to improve the performance

16
  • 2
    You can make a TGraphicControl descendant that will use some sort of virtual objects (like layers). You would have a list of virtual object definitions (object size, position, text, shape,...) and you would render to an offscreen bitmap by those definitons whenever any of the definitons changes. The rest would be about blitting the offscreen bitmap. Commented Jan 16, 2015 at 0:54
  • 3
    Nothing based on TGraphicControl can parent other controls. Commented Jan 16, 2015 at 1:03
  • @TLama that's a good idea but i'm using TScrollbox with panels and controls instead of TListView to be able to handle events on each control that is not possible using this method Commented Jan 16, 2015 at 1:04
  • 1
    Perhaps you could use a TFrame instead of a TScrollBox. I have some TFrames containing close to 1000 controls, and the TFrames scroll well. I divide the TFrame into sections using TGroupBoxes. Commented Jan 16, 2015 at 1:09
  • 2
    Why do you need containers? Commented Jan 16, 2015 at 7:26

2 Answers 2

1

You can also turn Form.DoubleBuffered := True to prevent flickery

Sign up to request clarification or add additional context in comments.

2 Comments

Double edged sword. Often leads to other problems. Usually better to draw it right in the first place.
You can try DevExpress LayoutControl. In my old project it simply holds over 50 controls.
0

instead of using controls in panel container , i used TPaintBox for each row to draw using canvas as suggested

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.