Example Code

Automatically show or hide scrollbars on multicolumn listboxes

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Coding that exemplifies how to automatically show or hide the scrollbars on multicolumn listboxes.

 

Description

Some codes require to enable or disable the scrollbar on listboxes when necessary. There is a VI shipping with LabVIEW that can do this for tree-controls, however no such code is available for multicolumn listboxes. The attached code contains a VI that will show or hide the scrollbars on the listbox it is given a reference to. Just place the VI in a rescale event case and run it once for each listbox you have on that front panel. In addition, you also need to run it when the items in the list(s) are changed.

Upgrades can be easily added.

 

 

Requirements

LabVIEW 2015 SP1 (or compatible)

 

Steps to Implement or Execute Code
1. Run the VI
2. Mark/ the check boxes and see how the bar appears/disappears
3. Resize the front panel in order to see how the scrollbars appears
4. Exit the application by clicking the red X in the upper right corner of the front panel


Additional Information or References

Snippet.png

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.