LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ControlArray - Item Order gets is being messed up

Hey,

 

hopefulls this is my last problem, before my first tool will be finished 🙂

 

I am using quite a lot ControlArrays to achieve some automated iterating during several measurements (different values will be written to textboxes automatically and so on). Therefore, its very important for the ControlArray-Items to have a correct order, but after sorting the Arrays, by time this order gets messed up.

 

Is there any way to finally FIX those orders, or at least to sort the ControlArrays at startup. This sorting could use standard "String-Sorting", because all those item have the same name, except of a rising number at the end of it, like "Button01, Button02,..." and so on...

 

Greetings

Mathias

0 Kudos
Message 1 of 2
(2,756 Views)

The order of the controls in the control array shouldn't change. It should stay in the same order that you configured in the UI editor or when you inserted the controls programmatically with InsertCtrlArrayItem.

 

There isn't a way to sort the controls in the control array. There are 2 ways to set the order of controls:

1) drag and drop controls in the UI object browser tree in the UI editor.

2) pass the index into the control array for the new control array item when calling InsertCtrlArrayItem.

 

If you need to sort the controls, you'll have to delete the item and then insert it with the desired index.

 

If the order of the controls is changing, please post more information about the scenario in which it changes so we can look into it.

 

0 Kudos
Message 2 of 2
(2,743 Views)