LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing combo box properties within type def

Solved!
Go to solution

I have a cluster of 32 instances of a type def. The type def contains several different control types. What I need to do is change the combo box properties for each of the type defs. Normally I would create an array of references to change properties for each of the type defs, but when I try this I cannot access the String[] properties for the combo box selections. The only way I have found to resolve this is to create a reference for each individual combo box element. This is labor intensive, since I will have 32 elements. Is there a beeter way to do this? The first screen shot shows the issui I am having, not being able to change properties of specific elements within each of the type def's when stepping through a controls[] array. The second screen shot shows the only solution I have found so far, which is not very practical.

 

 

Download All
0 Kudos
Message 1 of 4
(3,170 Views)
Solution
Accepted by topic author Citabria

You will need to cast (to more specific class) the control to a combo box type for the particular control [ ] index that has the combobox if you want access to the combobox.

you can also access the combobox of a cluster by reference directly, rigth click on the control ref and link to the clusters element driectly.

The last option is to make the typdef strictt this will populate all instances with the strings[] list since it is a strict property.

the approach depends on wether you plan on changing the list at runtime.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 4
(3,149 Views)

Here is an exaple:

 

21265iF986EB7209115082

Tim
GHSP
Message 3 of 4
(3,146 Views)

The first approach, cast to a more specific class, resolved the problem. Approach 2 I had already tried and was too inelequent for 32+ typedef clusters. Approach 3 would not work since changing properties needed to be dynamic within the program. I had 3 different combo boxes within the typedef, so to select the right one to update I checked the label name and made that the condition for changin the properties. See working code below.

0 Kudos
Message 4 of 4
(3,138 Views)