I have added a Tab Control with 7 tabs. The subforms and everything are working fine but I have one question. Can I change the Font Colour on the tabs? If so, how? I can't find a property for Font or ForeColour under Tab Control
No you can't change the color of the tabs. However, you can make the background of the tab control transparent (tabs will still be grey).
This is how I handled the problem. I set the BACKSTYLE property of the tab control to Transparent and set the STYLE property to none (tabs don't show up now). Then I simulated the tabs by placing labels above the tab control. I also set the BACKSTYLE property of the labels to Transparent (but you could make them any color you want). On the OnClick event of each label, I called the following function, passing it the name of the label the user selected. Basically what this function does is change the height of the label selected. By default, my first label is taller than the others indicating that it is the current one selected. You would be hard pressed to notice the difference between the labels and the actual tabs.
2 things to note: mstrLabelSelected contains the name of the label that is currently selected. So you need to initialize it in the OnOpen event of the form. I used FormHeader.Height as my anchor point. You could use the tab control itself, so that if you move the controls, you won't have to change your calculations here.
OnClick ... =SelectTab("lblFirstTab"
Option Compare Database
Option Explicit
Dim mstrLabelSelected As String
Public Function SelectTab(strLabelSelected As String)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.