Recent

Author Topic: [Solved] Z Order of Controls inside ScrollBox  (Read 511 times)

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
[Solved] Z Order of Controls inside ScrollBox
« on: November 29, 2022, 10:23:05 pm »
Hi, I have a list of buttons that are created dynamically inside a TScrollBox. All buttons are aligned alTop. What I need to do is change the vertical order of these buttons, say I add two extra buttons outside, an arrow up and an arrow down, when I click on a button it becomes selected. When I click on the arrow down I want the selected button to move in the Z order, so it goes to bottom.

That's possible with LCL?
« Last Edit: November 29, 2022, 11:04:34 pm by lainz »

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Z Order of Controls inside ScrollBox
« Reply #1 on: November 29, 2022, 11:04:22 pm »
Solved using FPObjectList and Move function.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2007
  • Fifty shades of code.
    • Delphi & FreePascal
Re: [Solved] Z Order of Controls inside ScrollBox
« Reply #2 on: November 29, 2022, 11:59:55 pm »
Ohh, I always was doing such by calculating height of the position where I want to be and set that to the Top property but I might have misunderstood.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: [Solved] Z Order of Controls inside ScrollBox
« Reply #3 on: November 30, 2022, 12:16:31 am »
Why not make them all invisible except for the one you want?
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018