Search code examples
delphitscrollbox

Two columns for components in a TScrollBox, Delphi


I wanted something like the attached scenario, where user can drag and drop a UI component(TImage) run time (Not from Tool Palette). We were using TScrollBox until now. However, I was not able to split it into two parts to accommodate the attached structure.

Components layout

We can have the second component in a row but it's optional. Also, the two components (row wise) should scroll in sync.

I was thinking to add two TScrollBox and use following code to synchronize vertical scrollbars: How to track scrolling of TScrollBox in Delphi

However, I couldn't find "Scrollbox1.VertScrollBar.Position" property.


Solution

  • Put two TPanels in it. One aligned to right, and size another yourself.

    enter image description here