04-09-2013 04:51 PM
I have a subvi whose front panel is a listbox expanded to fit the entire screen
In my main vi, I take the subvi reference and insert it into a subpanel. All is well in the world.
However, if at any point the subpanel width becomse too small, it will EAT the scrollbar and then the scrollbar will never come back. Here are a progression of pictures that illustrate this:
i have tried everyhing to fix this after the scrollbar has been borken:
1) programatically turn scrollbar off and then back on
2) remove the subvi from the panel and then re-insert
3) other stuff
I know that setting the panel width to a minimum width greater than the width of the scrollbar would fix this, but I do not accept that option because i would like to be able to collapse these subpanels and uncollapse on the gui
many thanks for any help
04-10-2013 02:54 AM
I'm guessing the problem is that the resizing code uses the current sizes, and the current sizes are always integers. This allows the operation to accumalate rounding errors and produce things like this. Specifically, in this case, when you resize to minimum, the SP size is probably rounded so that it's bigger than the pane. Then, when you resize back, it remains bigger.
One thing which I believe should work is using the pane size event to detect the resize, compare the old and new bounds to detect the last resize (they should be equal), and then call the Fit to Pane method on the control.