Tab Controls

B

Bill

Can one set the background of Tab Controls like
that of a form? E.g., like a form with a background
of "Expedition".

Bill
 
A

Al Campagna

Bill,
Make the BackStyle of the Tab Control Transparent. Whatever is on the main form, under
the Tab will show through. Could be a graphic, or text, or whatever.
 
A

Al Campagna

Well, you can place a rectangle on a Tab Page, move it to the back, and place your
controls over that (to front) giving that Page a "psuedo background" color.
 
B

Bill

Not sure I made myself clear. With the BackStyle of a
tab control set to transparent, I in fact get whatever the
background color, image, etc. is on the form. HOWEVER,
the tabs across the top are gray. All I see in the way of
formatting for the tabs is their font size and weight. Nothing
about the color of the font or the background color. (Maybe
I'm not being clear about the tabs across the top versus
the tab-page?)

Bill
 
B

Bill

I shall give it a try.... I often make use of Stephen's
utilities.

I'll post back with the outcome.

Bill
 
B

Bill

Al,
I see where Stephen gets the color from the
controls Tag property, but It's not clear that
simply setting the Tag is what establishes the
connection to his code. I.e., I don't know
what has to be done such that his code is
given control when the form displays?
Bill
 
A

Al Campagna

Bill,
I've never used Stephen's Color Tab, so I couldn't speak to that issue.
But, feel free to post that as a new question...
 
S

Stephen Lebans

Here is a previous post of mine on this subject:

' **********************************************
From: Stephen Lebans ([email protected])
Subject: Re: Background color on a "tab" form
View: Complete Thread (5 articles)
Original Format
Newsgroups: microsoft.public.access.formscoding
Date: 2002-01-30 16:26:05 PST


Open your form in Design view.


Select the TAB control itself...not one of the individual TAB pages. Enter a
value for the Tab Fixed Height and Width properties.


Now Select each of the individual TAB Pages in turn. Enter a color RGB value
in each Page's TAG property. If you are unfamiliar with RGB color codes
simply enter 255 for now.


You have to take the time to look at the code behind the sample Form. As you
can see from the code below you have to add code to the following
Sections/Events behind your Form/Tab control.


1) The Declarations section at the top of your Form
2) The Form Load and UnLoad events
3) The Tab control Change event.


The only things you have to change are the names of your Tab control and
the Rectangle control used to simulate a color for the Background of the Tab
control.
So in the sample, I named the TAB control "tabCtl" and the Rectangle control
"RecBG".
Just change these names to those of the controls you are using on your Form.
Me.TabCtl
Me.RecBG


There's nothing else to tell you. If you are not comfortable implementing
this code solution then honestly you simply should not use it.


Good Luck.


' Here's the code behind the sample Form.


Option Compare Database
Option Explicit


' Var of type Tab class
Private TB As clsTabs


Private Sub Form_Load()
'DoCmd.MoveSize 0, 0, 6650, 4800


' Create an instance of our TabColors class
Set TB = New clsTabs


' You MUST set the TabControl prop
TB.TabControl = Me.TabCtl
' You MUST set the BackGround control
' used to display the current pages background color
TB.BGControl = Me.RecBG
' Parent Form
TB.TabForm = Me


' Set the desired Rotation amount
TB.RotateDegree = 90


' Create the Tabs
TB.MakeTabs


End Sub


Private Sub Form_Unload(Cancel As Integer)
Set TB = Nothing
End Sub


' **********************************************



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
B

Bill

Hi Stephen,
While I was waiting for the "Re: post", I tried to find in VBA
HELP an explanation or description of "creating a class", which
seems to be what you did regarding tab controls. Your code:

Set TB = New clsTabs

seems to be how the connection, I asked Al about, is made.
More specifically, TB.MakeTabs is where you actually connect
to the standard modules?

Bill
 
A

Al Campagna

Looks like you hooked up with Stephen...
Don't forget to update your "new" post if you work it all out in this thread...
Good luck,
 
Top