LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Mads

Scrollbars on listboxes etc. that hide when they are not needed

Status: New

The current behaviour of scrollbars on multicolumn listboxes etc. is that they either show the scrollbar or not - however if there is no scrolling necessary they are greyed out.

 

In most non-LV applications this is not the case; there the scrollbars will hide if they are not needed. Such behaviour can of course be achieved programmatically, however it would be nice if it was coded into the scrollbars.

7 Comments
Darren
Proven Zealot

I agree this would be a great feature.  For now, we do have a VI you can use with Tree Controls.  See here

Mads
Active Participant

Thanks for the tip. Hopefully this will be in-built in the not too far future...but :

 

That VI inspired me to make a general VI that can be fired whenever the front panel is scaled...In my case I only needed to control the visibility of the horisontal scroll bar, but it could of course be expanded to both axis...just have to remember to offset the widths based on whether you end up showing or hiding the scrollbar on the other axis...

 

Here's my solution for now though (call on front panel rescale event):

 

 

ScrollVisibility.png

Message Edited by Mads on 06-26-2009 10:48 AM
Mads
Active Participant
One comment to my own code example - if you access the item names property all you need to do is to compare its dimensions to the "Number of Columns"/"Number of Rows" property - no summation of the widths/hights...very simple indeed...I overlooked that in my haste to wrap things up for the day. 🙂
Message Edited by Mads on 06-26-2009 11:03 AM
Mads
Active Participant

The problem with the latter technique is that the Number of Rows/Columns property includes the cell that is barely visible...so you get the scrollbars way too late. Perhaps the first idea is the one to go for...or perhaps it has just been a long day:-)

InfiniteNothing
Active Participant

Any work arounds for string controls?

CLED (2016)
fabric
Active Participant

This works for string controls:

ShowScrollbarIfRequired.png