LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tab control color

Solved!
Go to solution

I am working on a temperature monitoring VI that uses different tab controls. The VI cycles through the tabs at predetermined times. I have searched through the forums for a question like mine and I've seen some similar ones but nothing that is exactly what I'm asking for. I would like for the tab to change color, change font style/size, or anything of that matter whenever the current tab is showing. I would just like for it be very obvious at a glance which tab it is currently on. I've seen other posts where you could change the color of the tab, along with its contents, but I only want the tab itself to change, and only when it is highlighted. Is this possible to do? Thank you!

0 Kudos
Message 1 of 14
(8,700 Views)

First, you need to right-click the tab control and "allow multiple colors". Then you could do something as follows:

 

(what is your LabVIEW version?)

 

 

 

Of course once you initialize all tabs with the correct color, the event only needs to switch the color of the old and new tab. Probably more efficient.

 

 

Message 2 of 14
(8,689 Views)

If you only want to change the tab and not the tab page, you can use a radio button to replace the tabs.  I did not change the colors but you can modify the individual buttons either at edit time or at run time with property nodes.

 

Lynn

 

 

0 Kudos
Message 3 of 14
(8,680 Views)

@altenbach wrote:

First, you need to right-click the tab control and "allow multiple colors". Then you could do something as follows:

 

(what is your LabVIEW version?)

 

 

 

Of course once you initialize all tabs with the correct color, the event only needs to switch the color of the old and new tab. Probably more efficient.

 

 


I set up something similar to yours and it's working just fine for whenever I click on the tab manually, but a very important detail in my VI is that it needs to automatically cycle between two tabs. Whenever the tab swithces automatically, the color doesn't also swap. Not sure what I can do about it? Here was my attempt at making at work. Also, I have Labview 13.

0 Kudos
Message 4 of 14
(8,627 Views)

@johnsold wrote:

If you only want to change the tab and not the tab page, you can use a radio button to replace the tabs.  I did not change the colors but you can modify the individual buttons either at edit time or at run time with property nodes.

 

Lynn

 

 


Thank you for the suggestion, but I already have a lot of stuff in my VI written with tabs and I would hate to have to go back and switch everything to radio buttons 😕

0 Kudos
Message 5 of 14
(8,627 Views)

@jmejiagusmer wrote:
I set up something similar to yours and it's working just fine for whenever I click on the tab manually, but a very important detail in my VI is that it needs to automatically cycle between two tabs. Whenever the tab swithces automatically, the color doesn't also swap..


An instant repair would be to replace the local variable of the tab control with a signaling value property node. That would fire the other event. (A value change via a local variable or a plain value property node will not fire an event for good reason). 

 

(there are probably better solutions, but that should get you going).

 

(Also the multicolor property needs to be set only once. No property node needed.)

0 Kudos
Message 6 of 14
(8,608 Views)
Solution
Accepted by topic author jmejiagusmer

@altenbach wrote:
(there are probably better solutions, but that should get you going).

Here's one possible solution. Modify as needed.

Message 7 of 14
(8,600 Views)

@altenbach wrote:

@altenbach wrote:
(there are probably better solutions, but that should get you going).

Here's one possible solution. Modify as needed.


Yes, thank you! That's exactly what I needed. However, I did still want to keep the ability to be able to adjust how much time is spent on each tab and to only cycle between 2 of the 4 tabs. I don't understand your vi enough to be able to modify it enough to make that possible. I understand most of it, but i don't see what I would need to change in order to restrict it to only cycling between the two tabs and also be able to adjust the ratio of time spent on one tab vs the time spent on the other tab. On my previous code, I was able to get those things accomplished by doing what I have attached. 

0 Kudos
Message 8 of 14
(8,541 Views)

@altenbach wrote:

@altenbach wrote:
(there are probably better solutions, but that should get you going).

Here's one possible solution. Modify as needed.


I attempted to modify it and it seemingly works, except that I've lost the ability to select a tab and reset the timer. I'm not sure what to do at this point. 

0 Kudos
Message 9 of 14
(8,538 Views)

The event is registered to the tab value change. As a result, every time you click a tab, the event fires and changes the value to either 2 or 4. Thus, you change tabs to your selected tab and then almost immediately return to either Page 2 of Page 4.

 

In terms of "resetting the timer," I'm not sure what you mean. Could you elaborate?

--------------------------------------
0 Kudos
Message 10 of 14
(8,478 Views)