Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab control page: Change backcolor

Status
Not open for further replies.

mybers

IS-IT--Management
Mar 24, 2004
62
PH
Hello everyone here..


short question: Is it possible to change the backcolor of the tab control page (i.e. =white)? or at least make it transparent?

Thanks

 
Hello

I dont seem to find any issues of making the tab control pages to be transparent nor make the tabs color change...
more specific directions please...


Thanks in advance

 
You cannot change the background color of a tab control but you can make it transparent via the Backstyle property. But, your tabs are still shown. You cannot change the background color of the tabs nor can you make them transparent. But you can simulate tabs. Make the tab control transparent and set the Style property to none (no tabs shown). Create labels to represent your tabs (that are now invisible) and then create a function that simulates pressing tab buttons.

Here's how I made it work. First, set the OnClick event of each label to =SelectTab("NameOfTheLabel")

Then, insert this code into the code view of the module. This code keeps track of which label is currently selected (height raised) via the variable mstrLabelSelected. It also basis the top property on the FormHeader rather than the tab control. But, you can do it either way. This should help to get you started. Also, the reason I multiply by 1440 is to convert the units to twips.

Option Compare Database
Option Explicit

Dim mstrLabelSelected As String

Public Function SelectTab(strLabelSelected As String)

If (strLabelSelected <> mstrLabelSelected) Then

Me(mstrLabelSelected).Height = 0.2083 * 1440
Me(mstrLabelSelected).Top = (FormHeader.Height - (0.2083 * 1440))

Me(strLabelSelected).Top = (FormHeader.Height - (0.25 * 1440))
Me(strLabelSelected).Height = 0.25 * 1440

If (strLabelSelected = "NameOf1stTab") Then
tabCtl.Value = 0
ElseIf (strLabelSelected = "NameOf2ndTab") Then
tabCtl.Value = 1
End If
End If

mstrLabelSelected = strLabelSelected

End If

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top