12-08-2014 03:26 PM
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!
Solved! Go to Solution.
12-08-2014 03:53 PM - edited 12-08-2014 03:54 PM
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.
12-08-2014 03:59 PM - edited 12-08-2014 03:59 PM
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
12-09-2014 12:32 PM
@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.
12-09-2014 12:34 PM
@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 😕
12-09-2014 01:31 PM - edited 12-09-2014 02:14 PM
@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.)
12-09-2014 01:50 PM
@altenbach wrote:
(there are probably better solutions, but that should get you going).
Here's one possible solution. Modify as needed.
12-10-2014 11:04 AM
@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.
12-10-2014 11:44 AM
@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.
12-12-2014 07:56 AM
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?