To make my VI's look nicer I would like to add some free labels to a tab control on the front panel.
So editing the free texts in the tab control and placing a free text on the block diagram works fine with the attached VI's. (Note: place them both in the same folder)
However if I'm trying to add a free label to the Tab Control with the following code Labview generates error 1060 "LabVIEW: Object cannot contain (own) the specified object."
So now I'm wondering what I need to to in order to add text to the front panel with the help of VI scripting.
Hope you can help.
Solved! Go to Solution.
In one case you add a label to a panel, in the other to a tab control. Is there some panel-property for each page?
I haven't tried this specifically, but from your image I would guess that the New primitive simply doesn't recognize the page as a legitimate owner. I would suggest creating it in the pane or FP and then using the Move method on it to move it into the page.
2nd thought: On the top one you get the Decos on page-property, while on the lower picture you work on the page-property. What if you Add to the Decos-property-array a label-item?
On your 2nd thought: I don't think I need to add the label to the decorations array and/or that it is possible since the parameter is "Read Only".
You got the answer indirect. I first created the example below to check if I could create a color box on the tab's.
2nd I started browsing trough the style options in order to see if I could find something that would allow me to draw some other form of decoration. And by accident I found the "Label (system)" style (ID = 21961). So the following code generates a nice label on the tab and solves my problem.
Although NI refers to Front Panel text as a free label, the style "Free Label" is only for Block Diagram labels. They have an arrow in the lower right that can be stretched to another object for documentation purposes. A front panel "free label" cannot have that functionality so cannot be used there.