473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Tab Control Color

675 512MB
MSAccess says there is no way to have a Tab Control with a color. Is this true?
Dec 28 '07 #1
15 24983
jaxjagfan
254 Expert 100+
MSAccess says there is no way to have a Tab Control with a color. Is this true?
I dont know about 2007 but previous versions of access do not allow you to set tab colors.
Dec 28 '07 #2
OldBirdman
675 512MB
Thank you.

OldBirdman
Dec 28 '07 #3
missinglinq
3,532 Expert 2GB
You can change the back color of tabbed pages to that of the underlying Detail Section by setting the tab control's Back Style property to Transparent. If using ACC2003 and this doesn't work, goto Properties - Forms/Reports and make sure that Use Window Themed Controls is unchecked.

If you want a color other than the underlying color, even different colors for different pages, try Stephen Lebans Tab Colors Hack.

Linq ;0)>
Dec 29 '07 #4
OldBirdman
675 512MB
I tried "Stephen Lebans Tab Colors Hack." and don't see how to set tab color from this site.

If I am missing something, please tell me what?

OldBirdman
Jan 10 '08 #5
mshmyob
904 Expert 512MB
You cannot change the color of the tab only the color of the tab page. Not even in 2007.
Jan 11 '08 #6
missinglinq
3,532 Expert 2GB
Actually you can, as you'll see if you download Leban's Tab Sample Database. You'll find that Stephen never promises something unless he can deliver!

Birdman, what have you tried so far? I haven't really worked with Leban's code, just downloaded it and saw what it could do. His posted code usually deals with complicated issues and as such, are not simple! You do have to follow his instructions.

Linq ;0)>
Jan 11 '08 #7
mshmyob
904 Expert 512MB
I did try that download about 6 months ago and I couldn't get it to work also. But probably because I didn't fully understand it.

You would think that MS would have a property for this since people have been trying to do it for years.
Jan 11 '08 #8
OldBirdman
675 512MB
What a response to a question that I thought would require a one-word answer.

First, I guess the question was ambiguous, if not to me, then to many of you. I wanted the control to be of a different color, and was not necessarily needing the individual tabs to be colored. After all, my command buttons are all gray, so why not the tabs?

If I can change the color of the tab control, it is to make the BackStyle transparent. This will apply to all the pages of the TabControl. Individual TabPages are not independent.

My solution is to place a rectangle on the form, the same size and position as the TabControl. Then with the TabControl BackStyle = Transparent, the color of the rectangle comes through. I can even have each page a different color, by setting the rectangle color in the tab's OnChange Event.

I have been referred to Lebans before, and have downloaded & unzipped the sample programs. I have read the instructions on his website.

Lebans' programs always work as advertised. However, I do not have the knowledge to understand how/why they work, and cannot incorporate them into my programs. In this case, I don't think it actually works at all. I think that it apparently works, using movable pictures (Bitmaps). Maybe I'm mistaken here.

There is a second ambiguity in my initial question. Having Access do something, and having a program that apparently does something. My initial question looks like I was asking the later, but I was asking if Access can do it, not whether I make it look like it is being done.

OldBirdman
Jan 12 '08 #9
missinglinq
3,532 Expert 2GB
As I said, Leban's hacks ususally involve complicated issues, and as such the solutions aren't simple! As to Access directly addressing it, you have to realize that while this issue comes up occasionally, issues like mouse wheels scrolling thru records and the hiliting of alternating lines in a datasheet/continuous form come up daily in Access forums, and yet they've just got around to solving this with ACC2007!

This is a good workaround, OldBirdman! I'll copy it to my reference folder and use it in the future, giving credit to you, of course, and citing TheScripts!

BTW, I understand your comment about Access doing something as opposed to a workaround being available. If you want to make this distinction in the future, ask something like "is there a native Access process to do yada yada yada?" or "is there an Access built in way to do yada yada yada."

Linq ;0)>
Jan 12 '08 #10
OldBirdman
675 512MB
I shall remember that "Native Access" is different than an Access work-a-round. That should avoid some ambiguity.

Lebans' solutions are quite interesting. I do get lost in them, as I apparently use such a limited subset of Access that I don't understand most of what he is presenting.

OldBirdman
Jan 18 '08 #11
missinglinq
3,532 Expert 2GB
Most people looking for a solution don't really care if it's an Access built-in solution or a custom solution, but if you do it's good to note it in your thread.

And I agree, Lebans' solutions are frequently complicated, because, as I said, they usually deal with complicated problems! I've used them, but it always takes me quite a while to completely understand them, which for me is a must!

Linq ;0)>
Jan 18 '08 #12
I have spent the last several days on this issue, and have come up with a relatively easy and simple to implement methodology for changing the color of a TabControl in Access 2003. I'm sure this probably works equally well in Access 2007 although I have not personally tested it. Granted, this solution is not a "native" Access solution, but instead makes use of the Rectangle control (as detailed in posts above) to trick the user into believing the TabControl has the desired color. For more info and to download the code please visit ** Removed link to external code **

The link above has a much better description of the process and includes a very short, simple, code sample. Feel free to use it unrestricted.

This solution requires you to simply add a rectangle control (the size and position does not matter - although you would want to make sure it is "behind" the tab control in the Z-order. You then make a simple one-line call and the Tab changes color... It makes for a nice elegant solution.
Feb 21 '08 #13
OldBirdman
675 512MB
I appreciate your several days, as I have also spent many days on an issue that I can find no reason Microsoft cannot support.

First, I found that my Rectangle solution will overwrite some controls, such as labels. So I wish to retract the previously submitted solutions.

Now, I read "The best way to use this is to create an ActiveX DLL project using VB5 or VB6. Using Visual Studio .Net to accomplish this will only cause you more headaches since .Net does not easily accommodate being called from a COM compliant (unmanaged) application." I do not deny that this is perfectly valid, but I don't know what an "ActiveX DLL" is, nor do I know what VB5 or VB6 is. I don't know what Visual Studio.Net is either, which is why I look for Native Access Solutions, even very creative ones.

So we want simple, or at least I do. Here is the simplist I could devise.
1)Create a (sub)Form, and assign a background color.
2)Create a Tab Control on this form.
3)On the main form, use the form created above as a subform.
4)Size everything so a)Tab Control is exact size of its form; b) SubForm control is exact size of the form used.
5)Tabs will still be grey, but body of Tab Control will be colored. If this is acceptable, and after all, command buttons are all grey, then this is the simplist solution I can come up with. Note: it is "Native Access".

OldBirdman
Feb 24 '08 #14
sierra7
446 Expert 256MB
Hi

I was interested in fooling around with this. I have taken the code from MaxVernon's DLL and put into into an Access module to make it more 'Native'. This means that you do not have to register the dll 'AccessTC' or have a reference to it, which can be a bonus to some.

I have had to comment out code to make it run in Access 2002; apologies Max.

I've added a case statement to give control of the colours. They are hideous but it is a demo. Interestingly, controls do not show through from beneath.

Now I have seen this I want the Tabs coloured too!
S7
Attached Files
File Type: zip AccessTCSample.zip (16.0 KB, 872 views)
Feb 24 '08 #15
OldBirdman
675 512MB
When I started this thread, I really only wanted to have a little contrast between the TabControl and the background color of the form. Not have each tab a different color. I mean, I just don't like monochrome forms. Unless my form is gray, the buttons contrast. I even change the form color if the form is "Filtered", so I don't panic if I can't find a record I know is there.

I have spent the entire morning trying to figure out why the CommandButton and Label show in the demo program. Mine do not. It humbles me to not be able to find the difference, and so solve my problem. The demo program works, mine does not. Reviewing this entire thread, the answer is probably in the "Z order", and whether the rectangle is actually "behind" the tab control. Don't understand that, sorry maxvernon.

I'm running the demo program on my machine, so that eliminates the operating system, the version of Access, and the hardware. I have compared properties line by line, and I can't find any significant differences. Sure, I don't have all that fancy code to dynamically size and position the Rectangle, but that shouldn't affect anything.

I deleted my Rectangle and TabControl on my form, and did a Copy/Paste of both from the demo. Now the command button shows through the rectangle, but the label does not. Labels attached to controls show, including labels on options, checkboxes, and option groups. If the rectangle is larger than the tab control, I hides almost all controls on the form under the rectangle. The exception is a SubForm.

If I create a subform containing a tabcontrol, and both are the same size, the subform shows through everthing (always on top). I can control the color with Me.Form.Detail.BackColor = 14868389 (Bluish). This does work, so I have colored individual tabs with similar logic to the demo program.

I got an added benefit with this. I can have a tab control on a tab control. I pasted my subform onto several tab pages in the demo. Works very nicely. Several of the tabs have the subform, which is only a tab control. Both levels are IN COLOR!! Not the little tabs at the top, they are still gray, but the body of the tab control is in color. Now I put the color in the Tag property as an 8 digit number (so if I later need the Tag for another purpose also, Mid(ctl.tag,9) will work always because 252 (red) is entered as 00000252, etc. so color is always Left(ctl.tag,8).

Now I need to get proficient with referencing subforms from the main form, other subforms, etc. I have tried to change the subform's backcolor from the main form, but can't get the section recognized, but this is another thread.

Again, I want to thank all of you for a great deal of time involved in this issue. I'm not sure that all this effort was just for my benefit, seems like some got hooked on the problem. Again, thanks.

OldBirdman
Feb 25 '08 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Mike Minor | last post by:
Hello all... Is it possible to change the font size, color, and face of <input type=text> fields? Thank you, Mike Minor Z-Code Systems, Inc. mminorhsd@earthlink.net
3
by: charliewest | last post by:
Can some pls provide an example as to how to use the TypeConverter and/or WebColorConverter class to set a control color property to a hexidecimal value? Thanks in advance.
1
by: Angel | last post by:
How do you change the color of a control when the mouse enters the area of the control? And then change it back to the original color when the mouse exits the control? The Server controls do not...
4
by: Morten Snedker | last post by:
Me.tvKunder.ForeColor = Color.FromArgb(l) changes the color of the Treeview control 'tvKunder' immidiately. Using a loop: For Each c In Me.Controls If (TypeOf c Is ListBox) Or (TypeOf c Is...
2
by: Grant Edwards | last post by:
How do I get contour lines drawn in just one color (e.g. black)? Multicolored contour lines on top of a pm3d surface can be very hard to look at... -- Grant Edwards grante ...
2
by: larryparker | last post by:
I'm really frustrated by what seems to be a ridiculously easy task, and yet.... I'm trying to create a web page with a series of entries, each entry linked to another page. I want each entry to...
1
by: thirunavukarasukm | last post by:
Hai i created one ascx (Usercontrol)...file the user control file contain one panel and one check box if i go to click the check box the panel backcolor will change the panel control...
1
by: Chris | last post by:
I want to control the color of my validation control with css. There will be a high visability stylesheet where the background is black and the text is yellow. When I remove the color it defaults...
2
by: Karl | last post by:
I trying to use the slider control in A2000. I don't see a mouse up event and the Updated event doesn't seem to fire after moving the slider. I did get lost focus to work if I click on another...
1
by: =?Utf-8?B?UkJlbGw=?= | last post by:
I am trying to do something which I would have thought to be remarkably simple. I have a simple tab control that I would like to use non-standard colors for. I set the back color to whatever color...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.