LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combo box saving strings at run time

Solved!
Go to solution
Does anyone know if there's an easy way to save new strings into a combo box at run time? I've got a simple list of names of people who use my application - and I want to be able to add new names at run time - I realise I can do this already with 'allow undefined strings' - but I then want the control to remember the new name next time the VI runs. I've found the example 'Ring and Combo Box.vi' which will do the job, but this seems a bit like overkill to me - is there a simpler way or a better control I should be using? Thanks very much.
0 Kudos
Message 1 of 5
(2,758 Views)

Hi nickev,

you can read the values from a text file.

 

Mike

0 Kudos
Message 2 of 5
(2,752 Views)
Solution
Accepted by topic author nickev

you can edit the combobox's strings using property nodes:

 

add 2 cbox.png 

-Barrett
CLD
0 Kudos
Message 3 of 5
(2,748 Views)
You'll need to write the new values to a text file so that you can read them in the next time your code runs.  There's no way for a VI to modify itself while it's running, which is what you're asking (since the initial values for the combo box are saved as part of the VI).  You could either update that list at the time that a new value is entered, or when the code exits you could retrieve the list of values using a property node and write them to a file all at once.
0 Kudos
Message 4 of 5
(2,735 Views)
thanks for all these tips - combined them to get a working vi
0 Kudos
Message 5 of 5
(2,698 Views)