Disabling Click Detection of Disabled Listbox Item in LabVIEW

Updated Jun 22, 2023

Environment

Software

  • LabVIEW

When disabling a Listbox item using a property node, it is greyed out on the Front Panel, however Listbox Dbl-Click property detects if the disabled item is clicked, so the code ends up in the wrong case of the case structure. This article will discuss the workarounds for this issue.

The Dbl-Click property detects which row was double clicked in a Listbox. It changes its value, even if the double clicked row is disabled. 

Alternative solution could be finding another method of detecting which item is selected. 

  1. Right click on the Listbox control and choose Create>>Property Node>>Item Names and Value.
  2. Obtain the name of the selected item by indexing the Item Names array with the value obtained from Value property.
  3. Note that the Index Array function will return the name of the item currently selected in your Listbox as a string.

1.2.png

Now, you can compare the selected item with the item that is disabled and if they match, the code would not go into the Case Structure corresponding to the disabled item.

Another alternative would be to use grouped buttons, instead of a Listbox and detect value change with event structure. Third, to use alternative method of click detection, which can be found in this article.