Full Version: Tab Control: Change Tab Font On Active Page
UtterAccess Forums > Microsoft® Access > Access Forms
dg_moore
I found a solution to this for a previous project, but I've forgotten how it works and haven't been able to find the solution again.

I have a tab control with two tabs. I want the Tab font color to be set to red when the corresponding page is active, and to black when the other tab is selected (and vice versa).

I have examined my old working project but can find nothing in any of the modules, or in any of the tab control properties, that references or sets these properties. Is anybody familiar with this?

Thanks
theDBguy
Hi,

Did you try setting the Back Color and Pressed Color properties into two different colors?

Just curious...
dg_moore
Not yet, but will try tomorrow. I don't know how to toggle back and forth, though. If tab0 is red, then tab1 should be black, and vice versa. Tab controls don't provide any events that would cause code to run.
theDBguy
You shouldn’t need code but it does have a Change event you could use, if necessary.
dg_moore
Back Color/Pressed color did the trick. This is not the solution I recall from earlier (which was VBA), but it works fine.

Thanks!
GroverParkGeorge
Click to view attachment
Note that there is a Value property for each page in the tab control. You can use that to write code that manages the format and highlighting you need.
theDBguy
Hi,

Glad to hear it worked for you. Good luck with your project.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.