02-17-2015 04:47 PM
Hi everybody!
I have a question about a tab control.
I'm trying to figure out a way to programmatically change the properties of the tab labels so the selected tab's label looks different to the others.
I'd like to do this by changing aspects of it's font and it's color. But I can't find out how to access it either directly or by reference.
I can get at the label string so if all else fails I could make the selected one all capitals!
Am I missing something, or is this one of those things which can't be done?
I'm using Labview 11.
Regards,
Jonathan.
02-17-2015 05:16 PM - edited 02-17-2015 05:17 PM
Jonathan,
I could not find any way to modify the tab labels individually. Your idea seems like it will work, but if you change the label to all capitals you might have to be careful about making the string too big for the label area you have to work with.
Another option might be to use a simple line decoration right below the active tabs label. This doesn't require any programming which is nice but I'm not sure how well it gets the message across to the user of which tab is being used.
02-18-2015 10:35 AM
There is no way to programmatically access the properties of labels and captions on tab pages.
02-19-2015 09:45 PM
Thanks for your replies. You've confirmed my suspicions.
This tab control fills the front panel of a VI and is changed programmatically from another VI to show the different tabs.
For a workaround I'm setting the VI Title to the label of the currently shown tab and hiding the tabs on the actual control.
So there's no ambiguity about what the users see, as long as they bother to look at the window title!
Jonathan.
02-20-2015 09:58 AM
Jonathan,
You could hide the tabs and make your own by customizing a radio button control. You can have different colors and different text for the true and false states of the booleans. With a little effort you can make something which looks very similar to the existing tabs but has the features you want.
Lynn
02-20-2015 10:07 AM
Simpler yet, just put floating labels on each page.
02-20-2015 10:41 AM
Something like this
http://forums.ni.com/t5/LabVIEW/tab-control-color/m-p/3062557/highlight/true#M873360
02-20-2015 05:21 PM - edited 02-20-2015 05:22 PM
Omar,
Thanks. I looked but could not find that thread.
Lynn
02-23-2015 07:48 AM - edited 02-23-2015 07:51 AM
The link still works for me!
Search the forum for "Tab Color".
This does not change the text, but the tab color which is what I do to high light the selected tab.
I use dark gray and light gray to help the user tell which tab is "active".
Not exactly what you wanted.
http://forums.ni.com/t5/LabVIEW/tab-control-color/m-p/3062557/highlight/true#M873360
02-23-2015 08:25 AM
I think Lynn means he thought something like that existed, but couldn't find it when he went searching for it. I don't think he meant that he had problems using your link after you found it and posted it.