Jump to content

programmatically change tab names


Joernh

Recommended Posts

Hi there,

can anybody acknowledge, that it is not possible to change the names of tabs programmatically during runtime?! My attempts failed. I'd also like to know if it's possible to add or remove tabsheets?

Thanks for Reply

Regards

Joern

When I try to rename a tab control's page "pagelabel" from the VI that contains the tab control I get this error:

"Error 1073 occurred at Property Node (arg 1) in Untitled 1

Possible reason(s):

LabVIEW: This property is writable only when the VI is in edit mode,

or this method is available only when the VI is in edit mode."

Since a tab control looks like an Enum whose values are derived from the page labels, it doesn't suprise me very much that it works this way --- you cannot change an enum on the fly either. The same logic could be applied to adding or removing pages, since you cannot expect to add or remove values to an enumerated constant on the fly, you shouldn't expect to be able to do it to a tab control either.

FWIW, you should however be able to change it from another running VI just as long as the VI containing the tab control is not running.

Link to comment
When I try to rename a tab control's page "pagelabel" from the VI that contains the tab control I get this error:

"Error 1073 occurred at Property Node (arg 1) in Untitled 1

Possible reason(s):

LabVIEW: This property is writable only when the VI is in edit mode,

or this method is available only when the VI is in edit mode."

Since a tab control looks like an Enum whose values are derived from the page labels, it doesn't suprise me very much that it works this way --- you cannot change an enum on the fly either. The same logic could be applied to adding or removing pages, since you cannot expect to add or remove values to an enumerated constant on the fly, you shouldn't expect to be able to do it to a tab control either.

FWIW, you should however be able to change it from another running VI just as long as the VI containing the tab control is not running.

There is a way to change the tab captions. See enclosed example.

Wolfram

Download File:post-1013-1140005841.vi

Link to comment
When I try to rename a tab control's page "pagelabel" from the VI that contains the tab control I get this error:

"Error 1073 occurred at Property Node (arg 1) in Untitled 1

Possible reason(s):

LabVIEW: This property is writable only when the VI is in edit mode,

or this method is available only when the VI is in edit mode."

Since a tab control looks like an Enum whose values are derived from the page labels, it doesn't suprise me very much that it works this way --- you cannot change an enum on the fly either. The same logic could be applied to adding or removing pages, since you cannot expect to add or remove values to an enumerated constant on the fly, you shouldn't expect to be able to do it to a tab control either.

FWIW, you should however be able to change it from another running VI just as long as the VI containing the tab control is not running.

thanks a lot. Think you hit the nail on the head.

Link to comment
your example confused me since both properties of the tab-control are described as not changeable when the VI is running. But it works......

Hmph, learned something new. :thumbup:

It works because you are not replacing the enumerated value used as the page selector. You are just hiding it and instead displaying an independent (cosmetic) string in its place.

post-2800-1140012434.png?width=400

Link to comment
Hmph, learned something new. :thumbup:

It works because you are not replacing the enumerated value used as the page selector. You are just hiding it and instead displaying an independent (cosmetic) string in its place.

post-2800-1140012434.png?width=400

This was an addition to LabVIEW 6.1 exactly because you couldn't rename a Tab in a TabControl. Making a TabControl behave like a RingControl instead was no option as that would have caused problems with backwards compatibility and in fact removed some functionality and ease of use from the TabControl.

Rolf Kalbermatter

Link to comment
Hmph, learned something new. :thumbup:

It works because you are not replacing the enumerated value used as the page selector. You are just hiding it and instead displaying an independent (cosmetic) string in its place.

post-2800-1140012434.png?width=400

....nevertheless, independent label and tab caption are properties described as not changeable during runtime (at least in the german manual), but maybe its a misstake.

Thank you all for replying..... :worship:

Best regards

Joern

Link to comment
....nevertheless, independent label and tab caption are properties described as not changeable during runtime (at least in the german manual), but maybe its a misstake.

In english version (7.1.1) I see this:

post-3266-1140021166.jpg?width=400

post-3266-1140021172.jpg?width=400

So looks like you may have a typo over there (or is that a typographischer Fehler?) :)

Joe (orko)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.