Jump to content
Dan Bookwalter N8DCJ

Populating Combo Box in an Array

Recommended Posts

Ok I must be overlooking/overthinking this , but , I have an array with a cluster that has a String control and a Combo box that needs to get populated .... I cant seem to get the combo box to populate properly... how does one go about setting the string values of the combo box  in each cluster/array element , every element gets populated with different data.

 

Thanks

 

Dan

Share this post


Link to post
Share on other sites

You can't do it the way you want.  An array by definition means that every element in the array has the same properties, and only varies by value.  This means each combo box needs to have the same drop down items.  Now there are work arounds, like replacing the current items in a drop down with new ones as the user uses the control.  So if I click on the second element I can change those items when it is clicked.  I may have an example somewhere.  It basically involves capturing the mouse down? event on the combo box then using that reference to set the items.

  • Like 1

Share this post


Link to post
Share on other sites

Hooov

 

I was kind of worried about that .... I have already started down the road of populating as the user clicks on the control... I wish there was a more elegant way of doing this , but , I can deal with it this way ....

 

Or if a Multi Column list box would allow you to highlight different cells in columns I could work with that too... My limited messing with the multi column list box it didn't appear I can do that either...

 

Thanks

 

Dan

Share this post


Link to post
Share on other sites

Or if a Multi Column list box would allow you to highlight different cells in columns I could work with that too... My limited messing with the multi column list box it didn't appear I can do that either...

You can do this too.  Capture Mouse Down? then use the coordinates and the invoke node to get the row and column clicked, then set the background color the the blueish color.

 

LabVIEW can make software with any UI capabilities of any other programming language.  It just might take some work arounds.

  • Like 1

Share this post


Link to post
Share on other sites

Another option is to convert the array of cluster of... to a cluster of cluster of... This would let you set the values for each control independently. If you need to scroll through, a placing a scroll bar the value of which is used as the top index in your array of elements to populate the cluster of clusters with. This is quite code-intensive, but works well.

 

I had another thought about using the Mouse Down? event, determining if the drop down of a combo box was clicked, changing that to a right click, and generating the appropriate menu... then realized that wouldn't work for typing in a value.

Share this post


Link to post
Share on other sites

You can do this too.  Capture Mouse Down? then use the coordinates and the invoke node to get the row and column clicked, then set the background color the the blueish color.

 

LabVIEW can make software with any UI capabilities of any other programming language.  It just might take some work arounds.

 

 

Hooov

 

Thank you sir .... done....

 

Dan

Share this post


Link to post
Share on other sites

drjd preceded me, I wanted to point at that too. Despite my asking there, at the end of the story for that case I'm using a generous number of copies of my cluster, like suggested, playing with visibility and position to show only those I need; accessing individual "elements" and manipulating their cosmetics via an array of their references, and opportune property-by-reference accessors.

Share this post


Link to post
Share on other sites

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.