LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Easy way to change visibility for more than one button?

I have a lot of elements in my front panel that I wan't to hide and show while the program is running, and while I know that I could do this by making a property node for each element I'm wondering if there is a easier and less messier way to do it? For instance a way to set the property node visibilty status for all the elements at the same time? 

0 Kudos
Message 1 of 6
(2,597 Views)

Create an array of references of your controls.  You can then use a FOR loop with the property node inside to iterate through the control references.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(2,593 Views)

Please look at a simple example I posted. This shall make *ALL* FP Controls visible/invisible based on the T/F constant wired in the for loop.

I've attached the VI in LabVIEW 2012. You will have to write some more code to customize this. You might want to extract the label of the FP control or maybe the index so you can choose which ones to hide and show.

 


Kudos are the best way to say thanks 🙂
Message 3 of 6
(2,585 Views)

Thanks a lot!

0 Kudos
Message 4 of 6
(2,584 Views)

One way is to put the controls on a tab control, then just change the visibility of the tab control.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 6
(2,521 Views)

In case anybody was wondering in SK8's example vi the 'Tab Order' determines the index of the control in the array of control references so you could have an array of Boolean into the loop to show or hide specific controls.

 

Funnily enough The Panel Property Controls[] returns the indicators too!

 

Ken

0 Kudos
Message 6 of 6
(2,517 Views)