LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controls within several level of tab controls.

Solved!
Go to solution

I want to handle the enable/disable of controls when the program starts.

Specifically, I want to find controls within a tab control. Somehow I have to use a 2-level tab control.

 

If you have tab controls within tab controls and in turn multiple levels of tab controls within them, you'll likely have to manually process the attached routine multiple times.

(controls of tab of tab of tab of tab ...............)

 

Is there a way to use it recursively?

Or is there any other good way?

 

labmaster.

0 Kudos
Message 1 of 5
(820 Views)
Solution
Accepted by topic author labmaster

Recursion would probably be the best.

 

  • I think that having deeply nested tab controls doesn't make for the best user interface.
  • You don't need to close references to GObjects.
  • Use proper error flow.
  • The "To More Specific Class" function does nothing here.
  • Clean up your code before you present it.

The attached VI is functionally the same as your original; but simplified and cleaned up.

0 Kudos
Message 2 of 5
(802 Views)
Solution
Accepted by topic author labmaster

Hi,

 

You can get all controls recursively using the scripting method "Traverse for GObjects.vi" (it also works in the runtime engine for VIs that have a front panel):

 

raphschru_0-1688484767704.png

 

Here I added a filtering to eliminate controls that are sub-elements of other controls (such as elements of cluster/array/map/set/refnum…).

 

Regards,

Raphaël.

 

0 Kudos
Message 3 of 5
(748 Views)

Thanks all for comments.

I was surprised about "Traverse for GObjects.vi".

Can you introduce useful codes for some general purposes?

 

labmaster.

0 Kudos
Message 4 of 5
(719 Views)

@labmaster wrote:

Can you introduce useful codes for some general purposes?


What do you mean ?

0 Kudos
Message 5 of 5
(709 Views)