Jump to content

String Control Scroll Position changes on resize


Recommended Posts

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

Link to comment

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?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.