LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use scripting to change Tab Name

Solved!
Go to solution

Hello All,

 

  I am attempting to use scripting to add new tabs to a tab control in an existing VI.  I am able to add the new tabs pretty easily, but I cannot figure out how to change the name of each tab as they are added.  Each name is extracted from a TDMS file using a for loop. 

 

  I have looked through the existing discussion forums, and there are a few older posts that indicate I should be looking for the "Independent Label Property", and that I should set this to allow me to change the tab caption.  There is still an explanation of this property in the help files, but I am unable to find my way to it in the actual block diagram. 

 

  Assuming that this property still exists in my version (2012), could somebody point me to the correct sequence of references and property nodes to get to this property?  Right now I am using the "TabControl" class.  If this particular property is obsolete, can somebody let me know if there is a new method to achieve this?  Thanks. 

 

GSinMN 

0 Kudos
Message 1 of 5
(2,286 Views)
Solution
Accepted by topic author GSinMN

After you add the page, get the Pages property of the Tab Control, index to the newly added page, use the PageLabel property of that page to set the label.  It would be cool if the Add Page method returned the reference to the new page.

0 Kudos
Message 2 of 5
(2,272 Views)

Hello Darin,

 

  Thanks for the quick response.  Your message gave me an alternate method, and also pointed to the solution to correct my method.  I was still using the refnum for the Tab Control.  What I needed to do is open a new "sub" refnum for the page.  From there, the IndependentLabel and TabCaption properties were easy to find.  Yes, it would have indeed been easier if the "Add Page" property automatically provided a refnum for the page it added.   

 

Thanks again,

 

GSinMN   

0 Kudos
Message 3 of 5
(2,260 Views)

Can you kinldy add an example that shows how you created /added additional pages?

 

Thanks

 

 

0 Kudos
Message 4 of 5
(2,190 Views)

add tab control page.jpg

0 Kudos
Message 5 of 5
(2,166 Views)