John Lokanis Posted May 21, 2015 Report Share Posted May 21, 2015 This seems like it would be a simple thing to fix but I can't seem to find a way and could not find any posts on NI or LAVA about it so here goes: I have a string control with a vertical scroll bar viable. This string control fills the entire pane. I have it set to scale objects with pane. I also have the pane set to scale objects as the pane resizes. The problem I have is when the user resizes the window, the string control will scroll to the top. So, if the user is looking at some data at some point below the top, as soon as they try to make the window bigger to see more data, they lose their place as the scroll position is change to the top again. This is very frustrating. I have tried to find a programmatic solution. There is a panel resize event that I can use to reset the scroll position back to the desired spot. Unfortunately there is no 'panel resize?' event to capture the current scroll position. I have been able to store the position in a SR when the mouse moves over the control using another event. But, this still results in very jerky behavior when resizing as LabVIEW keeps scrolling the string to the top while my code fights to keep it as the right spot. Does anyone know a better solution to this? And can someone at NI explain why this behavior exists and if it will be corrected in a future release? I cannot think of a benefit to having the control behave the way it does. I have attached a simple example demonstrating this effect and my current attempt to address it. -John Scroll on Resize Effect.vi Quote Link to comment
pallen Posted May 21, 2015 Report Share Posted May 21, 2015 Hi John, I don't have a definitive answer. But perhaps using defer panel updates until after you've repositioned your scrollbar would eliminate the jerkyness? Quote Link to comment
John Lokanis Posted May 21, 2015 Author Report Share Posted May 21, 2015 Yes, I could undefer the panel when the resize completes, but where can I turn defer on? I need a 'panel resize?' filter event or something equivalent. Quote Link to comment
pallen Posted May 21, 2015 Report Share Posted May 21, 2015 Yes, you're right. I've also just noticed that the scroll bar resets its position even if the code isn't running. Even without a scroll bar, the string control scroll to the top as soon as it's resized. I wonder if that behavior can be turned off somehow? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.