give tabs color

I would like the feature of giving a tab (in tabpanel) a specific color.
What I mean is, giving color to the selected tab!

also the background color and forgroundcolor of the maintab are not working at all!

You can set the tab background and foreground color using:

elements.tabs_70.setTabBGColorAt(number, String)
elements.tabs_70.setTabFGColorAt(number, String)

Supply the number of tab to set, and the string of the color.

To color the currently selected tab - you need to add an “onShow” method to each of the forms in the tabpanel - and then have it reset the color of all tabs to the default color - then change the color of the correct tab.

I agree - it would be nice to have a property for “setCurrentTabBGColor” and “setCurrentTabFGColor”.

Bob Cusick

Trying the above suggestion, I am unable to affect the color of the currently selected tab in a tabpanel. Here is the onShow method attached to one of the forms:

//Load all records in the form (removes any limiting foundset)
controller.loadAllRecords();

//reset all tabs to default color , then set color of selected tab
forms.setup_panel.elements.tabs_70.setTabBGColorAt(1, null);
forms.setup_panel.elements.tabs_70.setTabBGColorAt(2, null);
forms.setup_panel.elements.tabs_70.setTabBGColorAt(3, null);
forms.setup_panel.elements.tabs_70.setTabBGColorAt(2, '#FFFFFF');

The unselected tabs change color, but the currently selected tab remains the default ‘selected’ color. Am I possibly up against a Look & Feel limitation? I am using the ‘Metal’ L&F in this case.

Steve In LA

Hi Steve,

I haven’t tried with the Metal LAF (don’t have it).

I use the bgColor property of tabs all the time with no problems (in Kunstoff or Windows LAF).

Bob Cusick

Hi everyone,
We experience a similar trouble with tabpanel, whatever we try we were unable to set a tabless tabpanel to be transparent.
(We use it to have contextual icon bars in custom controller, with transparent buttons and a texture[imagemedia])
Using 2.1.1 beta on Windows XP and OsX.