On my FP, I have an array control that can hold more elements than can fit on the screen, so I am showing the control's scrollbar to allow access to all elements. Unfortunately, when the user scrolls to the end, they see 1 unfilled array element... If the user clicks on this element, then it grows the size of the array, which I do not want to have happen. Is there a way to prevent LabVIEW from displaying the extra element while also showing the scrollbar?
(As a work-around, I can use the Event Structure to detect a value change, and if the array size changes, I can revert the array back to the "OldVal", but I'd prefer not seeing the unfilled element in the first place.)
Wow... I just spent a bit of time designing a new control that had an array of clusters with the scrollbarbecause I had more items than would fit onscreen. When testing it, I encountered the 'extra element' problem (I had never used scrollbars on arrays before, and did not imagine that this would be how they worked).
I'm very disappointed in NI's implementation of the array scrollbar. I can think of NUMEROUS applications where one would want to do what we are doing - create a dynamic list of elements, and allow the user to view/select ONLY THOSE ELEMENTS. One should not have to resort to using an X-Control to obtain a 'scroll only to last element' behavior.
What about disabling the array control with a property node? Does the user have to click on the array for any reason? If it is just for display, can you use an indicator instead of a control?
Or customize the array...
1) Find a slider that you would like to use for the slide.
2) Set is as U32 and set range action to Coerce if out of range.
3) Customize >>> Save as a control.
4) Pop-up on the array container and hide scroll bar but make sure index display is still shown.
5) Customize the Array container Goto blow-torch mode.
6) Pop-up on the index control and choose "Replace" with the control you saved in step #3 above.
7) Exit blow-torch mode and close the Control editor and replace the control you stated with with the new version.
😎 Pop-up on the new scrool bar and create a property node for the range.
9) Run the VI and after the property node executes, you have an array control where you can limit the range of values.
A quick hack of that is attached.
There is still another way.
You can make the top of my slider 0 and the bottom 5 or what ever.
You can alos pop-up and hide the scale.
Also not that NO extra code is required in this example.
Ben, this is a nice idea. I have run into a problem though: I can only replace the index control with an old-fashioned slider, not an actual scroll bar control - LabVIEW just beeps at me when I try it. So, the result looks strange. The only way I've been able to get an actual scroll bar is to build an XControl.