Reputation: 229
I'm trying to make an app with a grid of images/buttons that starts different process on my PC from my Android phone but I'm having a hard time making it "scrollable" now that I've run out of space on the main screen. How do I utilize the scrollbox items? I'm having one right now but it doesn't work at all. I read somewhere that the items withing the scrollbox needs to be bigger than the scrollbox boundaries but how do I make my next 4x4 grid show up within the box then? I know I could use panels and just a simple "1, 2, next" system but I'd rather have it scrollable and preferably endless scroll so if I get to the last page it will return to page 1. I don't have any code at the moment to provide but I have this picture to show. I want another grid like this if I swipe to the right or left. I don't know really how to describe it in any other way, hope you can help me out.
Upvotes: 1
Views: 1423
Reputation: 4211
You need to place a control such as a TLayout as the immediate child of the TScrollBox. Set it's Position at (0,0) and Height/Width as necessary for your controls. This size is what is used by the scroll box for it's scroll bars.
Then place your actual controls onto the TLayout. As you add or remove controls, resize the TLayout and the scroll box will adjust it's scroll bars as necessary.
Upvotes: 2