I have a Listbox or Tree control in my LabVIEW VI's Front Panel, and I want to programmatically enable and disable the items inside so my users can't select them under specific circumstances.
According to the LabVIEW Help document: Disabling or Enabling Listbox and Tree Control Items, you can use the Disabled Items property to disable listbox items programmatically and the Active Item:Disabled? property to disable tree control items programmatically.
Here are some examples on how the code looks like for these functions:
When using the Listbox control, you will use the Disabled Items property, which will take an array of indexes for the elements you want to disable. If you want all the elements to be enabled, then wire an empty array.
Note: Writing zero (0) into the input array elements will disable the element in the index zero (0), which will be the first one.
When using a Tree control, you will use the Active Item:Tag Property, and the Active Item:Disabled? properties. The first one will select the element you wish to modify, and the second one will set its state to enabled (FALSE) or disabled (TRUE).
Note: The Tag property should be on top of the Disabled? Property since property nodes execute top to bottom.
Thank you for your feedback.
You changed your response to Not Helpful
You changed your response to Helpful
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.