Tab Control Color

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OldBirdman
    Contributor
    • Mar 2007
    • 675

    #16
    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

    Comment

    Working...