From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tab control page label change color programmatically

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.

0 Kudos
Message 1 of 11
(6,041 Views)

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.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 11
(6,026 Views)

There is no way to programmatically access the properties of labels and captions on tab pages.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 11
(5,993 Views)

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.

0 Kudos
Message 4 of 11
(5,964 Views)

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

0 Kudos
Message 5 of 11
(5,936 Views)

Simpler yet, just put floating labels on each page.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 11
(5,929 Views)

Omar,

 

Thanks.  I looked but could not find that thread.

 

Lynn

0 Kudos
Message 8 of 11
(5,894 Views)

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/How-can-I-change-the-font-color-size-of-tab-controls/m-p/967920/high...

http://forums.ni.com/t5/LabVIEW/Programmatically-changing-page-color-in-a-tab-control/m-p/840699/hig...

http://forums.ni.com/t5/LabVIEW/tab-control-color/m-p/3062557/highlight/true#M873360

Omar
0 Kudos
Message 9 of 11
(5,851 Views)

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.

0 Kudos
Message 10 of 11
(5,844 Views)