Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
2 ratings:
 5 out of 5   

Changing the Properties of Controls and Indicators in a Tab Control Container Using VI Server



Primary Software:
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>LabVIEW Full Development System, LabVIEW Development Systems>>LabVIEW Base Package

Problem:
When you use the Controls[ ] property in a property node to get refnums for the controls and indicators on the Front Panel, the refnums for controls and indicators that reside in a Tab Control container are not returned. Without the refnums, the properties of those controls and indicators cannot be accessed.

Solution:
Refnums for controls and indicators that reside in a Tab Control container can be found by creating a Tab Control Property Node. To get control refnums for controls or indicators in a Tab Control container, use the following method:
    1. From the VI property node, select the Panel property.
    2. Place another property node on the block diagram and wire the refnum output of the Panel property to the new property node.
    3. From this new property node, select the Controls[ ] property.
    4. Use an Index Array VI to index the refnum for the Tab Control.
    5. To force the refnum to be recognized as a Tab Control Class, use a To More Specific Class VI. On the Target Class Input of the To More Specific Class VI, create a constant and select Generic » GObject » Control » Page Selector » Tab Control.
    6. Place a third property node on the block diagram and wire the refnum output of the To More Specific Class VI to the new property node.
    7. From this new property node, select the Pages property.
    8. Index the refnum corresponding to the page on which the controls you wish to access reside, and wire it to a fourth property node. You can also use a For Loop to index each page of the Tab Control.
    9. From this new property node, the CtlsOnPage property outputs an array of refnums for the controls and indicators on the selected page of the Tab Control container.
    10. Index the CtrlsOnPage refnum array to get a reference to the control or indicator you want. You can also use a For Loop to index each control and indicator on the Tab Control's page.
    11. Use a fifth property node to access any of the properties of the control or indicator you've chosen.
Attached is an example program that demonstrates this solution.

Related Links:
Developer Zone Tutorial: Control References: Overview
KnowledgeBase 3OI8L8IZ: Accessing the Controls in a Tab Control Programmatically?

Attachments:


TabControl.llb


Report Date: 10/15/2003
Last Updated: 02/22/2008
Document ID: 32EGUHRF

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit