• Welcome to PlanetSquires Forums.
 

Creating a scrollable tab in a window

Started by Andrew Lindsay, January 31, 2016, 07:38:12 PM

Previous topic - Next topic

Andrew Lindsay

Hello,


I'd love to know if it's possible to create a scrollable tab child.


Basically, I'd like to be able to scroll a form up and down within a tab control's child form because I have too many items to fit on the tab area, but don't want to break it across multiple tabs.


Any assistance would be appreciated.


Regards


Andrew

Paul Squires

Yes, this can be done. I use this technique in the FireFly designer itself. The visual design space allows for scrollbars in order to accommodate forms larger than the physical screen size. I will need to dig out that code to see if I can make a good example for you. I seem to remember this question being asked before.... maybe I already answered a similar question from someone else? Not sure. :)
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

I have attached an example of how to scroll a form using scrollbars. It is based on some VERY old code that I used years ago in FB. I am using a global TYPE to hold the viewport information but a better approach would be to tie the info to each form using SetProperty or similar.

I am sure that there must be better and more efficient ways of doing this, but the code attached does work well.

Remember to set the WindowStyles of the main form (frmMain) to have HSCROLL and VSCROLL scrollbars set. I used a non-modal child form to house all of the controls that need to be moved whenever the scrollbars are manipulated. That is much easier than moving each individual control.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Andrew Lindsay

Thanks Paul,


This will give me something to study over the next day or so.  I'll probably be back again asking silly questions about it soon enough though, or who knows, I may even be able to implement your idea of using the SetProperty.


Regards
Andrew