Jump to content

Combo box control


jay

Recommended Posts

Hi,

Really simple question, but I can't seem to find the answer.

I have a combo box on the front panel that I dynamically populate with items at runtime with sound devices attached to the terminal, and I would like to programmatically select a device in the combo box as a 'default' if that particular device is attached i.e. scan devices at startup, search devices, if a particular device is attached then display that device in the combo box, effective making the selection for the user. It's still important that the user is still able to use the drop down list to select another device if they so choose.

Can someone please describe how I can select a particular item in the list to display as a default choice? I assume there is a property that can be set - but for the life of me I cannot find it.

Thanks.

Link to comment

Hi,

Really simple question, but I can't seem to find the answer.

I have a combo box on the front panel that I dynamically populate with items at runtime with sound devices attached to the terminal, and I would like to programmatically select a device in the combo box as a 'default' if that particular device is attached i.e. scan devices at startup, search devices, if a particular device is attached then display that device in the combo box, effective making the selection for the user. It's still important that the user is still able to use the drop down list to select another device if they so choose.

Can someone please describe how I can select a particular item in the list to display as a default choice? I assume there is a property that can be set - but for the life of me I cannot find it.

Thanks.

Hi,

You can use a property node to set the "value" or the "value (signaling)" property of your combo box, the difference between the two is that the first one will NOT generate a value change event on the combo box (event that you might want to detect with an event structure).

So, populate you combo box with you device list, check if a known device is connected, if yes, set the combo box value to the name of that connected device.

Quick example attached in LV 8.6

Hope this helps

combo box.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.