LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dual entry options (String / Enum)

I have a program that uses an enum so that I can have a drop-down menu on the front-panel in order for the user to select a name out of a list of names.

What I would like however is that if the user does not find the name that they are after in the list, they would have the option of typing into the field as in a regular string control in order for me to create a new entry without the need for having a different control for new entries. Is this possible?

Ken
0 Kudos
Message 1 of 3
(2,679 Views)
Hi Ken,

There's no direct way of doing this, but would be possible if you write some code as a workaround.

I would recommend not using Enum and instead use a Ring Control, as this gives you the flexibility of adding items to the 'list' during run-time. You will need to make use of a property node in order to update the list with new entries. You will probably need to have one permanent entry that the user can click on, and this would invoke the code required to add a new item to the list and update the 'new' array. If I get time, I'll try to create an example, but can't promise. Which version of LV are you using.

With LV8.0 an XControl could be used to make the functionality more professional as well as creating your own Control short-cut menus etc.
0 Kudos
Message 2 of 3
(2,643 Views)
I've quickly created this example in LV7.1 format. It does the job, but isn't a perfect solution and as you'll see the code is pretty rough. Hopefully this will give you a few ideas on how you could achieve what you're after. The code could probably be greatly improved using other nodes etc. but at least you can see my line of thinking.

Hope this helps!
0 Kudos
Message 3 of 3
(2,641 Views)