Hi everyone. I’m here to pick your brains again . I’ve been writing and throwing code all afternoon on this and I just cannot find a solution. I have finally come back to my initial (and simplest!) code, which seems to work the best. Here’s my problem :
I have a resizable window containing a TabPanel locked to all sides of the window, with three tabs. Each TabPanel contains a listbox locked to all sides of their respective TabPanels. I need to let users change the size of the ListBox along with the window) in tabs 0 and 3, but not in tab 2.
I defined a 2D array, “windowDims(2,1)” property in the window properties, to hold the dimensions of the window for each TabPanel and defined the initial sizes in the “Open” event of the window. I also defined the Integer “curPanIndx” to hold the current SelectedPanelIndex.
In the TabPanel “Change” event I put this :
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// Set the window size to the stored settings
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<curPanIndx = Window1.TabPanel1.SelectedPanelIndex
Window1.Width = windowDims(curPanIndx, 0)
Window1.Height = windowDims(curPanIndx, 1)
In the window “Resizing” event I put this :
curPanIndx = Window1.TabPanel1.SelectedPanelIndex
If curPanIndx = 1 then return // Panel 1 needs to stay the same size
… to prevent panel 2 from being resized, and in the window “Resized” even I put this :
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// Set the stored dimensions to those of the current window
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<curPanIndx = TabPanel1.SelectedPanelIndex
If curPanIndx = 1 then return // Panel 1 needs to stay the same sizewindowDims(curPanIndx, 0) = Window1.Width
windowDims(curPanIndx, 1) = Window1.Height
… and that’s about it.
It works fine for the horizontal window size and if I change the sizes when on each tab, they each “remember” the width setting and recall it correctly. The height setting however doesn’t work ! If I change it in tab0 then move to tab2, tab2 has the same height as tab 0. If I change to tab 1, the height becomes that odf the initial stored state for tab1, and as from there, all tabs take on this height ! The widths continue working correctly.
I just cannot figure out what’s going on here
Could some kind soul put me right, or is what I’m trying to do, not possible ?
Thanks in advance.
P.S. If I can figure out how to do it, I’ll post a demo file.
This maybe ?
Demo