LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combo box list update on menu acivation?

Solved!
Go to solution

Hi,

 

I have combo box which the user can click on. Once its clicked I'd like to dynamically refresh the strings the user can select. I attempted to solve this like below:

 

1984_0-1785764599641.png

 

In this example the new strings come from a listbox, but the mechanism does not matter. The problem is that when the user clicks the dropdown arrow, it displays its current values and fires the event after that so no matter that I rewrite the strings[] in the CmbBox the old values are already on the screen and they not get updated. If I click away (menu closes) then click the arrow again then right values, but obviously I'd need the right values straight away. 

 

What would be the right way to solve this without watching the input array and prewrite the values to the CmbBox if the input changes? (doable, but I'd like to avoid this as I have multiple comboboxes on the screen)

 

VI is attached for testing.

0 Kudos
Message 1 of 3
(341 Views)
Solution
Accepted by 1984

@1984  a écrit :

What would be the right way to solve this without watching the input array and prewrite the values to the CmbBox if the input changes? (doable, but I'd like to avoid this as I have multiple comboboxes on the screen)


Hi,

 

If you don't want to update all CmbBoxes for each input change, you will update a CmbBox every time the user interacts with it.

The simplest solution I can think of is to replace the "Operate Menu Activation" event with "Mouse Down?" event.

Message 2 of 3
(330 Views)

Its solved, thanks!

0 Kudos
Message 3 of 3
(318 Views)