Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PosNameTypeDescriptionDefault
<1>Normal Colors
<1, 1>Normal Text ColorColorThe tab's text color in its normal state"None"
<1, 2>Normal BackgrounColor FillThe tab's background in its normal state"None"
<2>Hot Colors
<2, 1>Hot Text ColorColorThe tab's text color when hot"None"
<2, 2>Hot BackgroundColor FillThe tab's background when hot"None"
<3>Select Colors
<3, 1>Select Text ColorColorThe tab's text color when selected"None"
<3, 2>Select BackgroundColor FillThe tab's background when selected"None"
<4>Disable Colors
<4, 1>Disable Text ColorColorThe tab's text color when disabled"None"
<4, 2>Disable BackgroundColor FillThe tab's background when disabled"None"
<5>Pane BackgroundColor FillThe pane background to be used when the tab is selected"None"

...

The TabColors property allows you to customize the tab's text and background colors. By default, these are set to "None", which means that the current Windows theme is used to render the tabs. There is an important rule you need to know when using custom colors.

First, the AllowXPTheme property must be set to 0, even if you haven't yet set the property to 1. This ensures that the other controls on the form are properly subclassed. Failing to do so will result in something like this:

...

Code Block
// set a red, green, and blue tab without borders or custom panes 
Colors = "" 
Colors<1, 2> = "Vertical(Gradient(Red L=90, Red L=80), Gradient(Red L=75, Red L=80))" 
Colors<2, 2> = "Vertical(Gradient(Red L=100, Red L=90), Gradient(Red L=85, Red L=90))" 
Colors<3, 2> = "Vertical(Gradient(Red L=95, Red L=85), Gradient(Red L=80, Red L=85))" 
Colors<4, 2> = "Vertical(Gradient(Gray L=90, Gray L=80), Gradient(Gray L=75, Gray L=80))" 
Colors<5>    = "None" 
rv = Set_Property(@Window:".OLE_TAB", "OLE.TabColors[1]", Colors) 
Swap "Red" with "Green" in Colors 
rv = Set_Property(@Window:".OLE_TAB", "OLE.TabColors[2]", Colors) 
Swap "Green" with "Blue" in Colors 
rv = Set_Property(@Window:".OLE_TAB", "OLE.TabColors[3]", Colors) 
rv = Set_Property(@Window:".OLE_TAB", "OLE.AllowXPTheme", 0) 

// set a red, green, and blue tab with borders and a custom pane 
Colors = "" 
Colors<1, 2> = "Vertical(Gradient(Red L=80, Red L=90), Border(Red))" 
Colors<2, 2> = "Vertical(Gradient(Red L=90, Red L=95), Border(Red))" 
Colors<3, 2> = "Vertical(Gradient(Red L=85, Red L=95), Border(Red))" 
Colors<4, 1> = "Gray" 
Colors<4, 2> = "Vertical(Gradient(Gray L=80, Gray L=90), Border(Gray))" 
Colors<5>    = "Vertical(Gradient(Red L=95, Red L=80), Border(Red))" 
rv = Set_Property(@Window:".OLE_TAB", "OLE.TabColors[1]", Colors) 
Swap "Red" with "Green" in Colors 
rv = Set_Property(@Window:".OLE_TAB", "OLE.TabColors[2]", Colors) 
Swap "Green" with "Blue" in Colors 
rv = Set_Property(@Window:".OLE_TAB", "OLE.TabColors[3]", Colors) 
rv = Set_Property(@Window:".OLE_TAB", "OLE.AllowXPTheme", 0) 
    
// set a custom theme to be used by all tabs 
Colors = "" 
Colors<1, 2> = "Vertical(Gradient(S L=95, S L=85), Gradient(S L=80, S L=85))" 
Colors<2, 2> = "Vertical(Gradient(S C S=100 L=95, S C S=100 L=85), Gradient(S C S=100 L=80, S C S=100 L=85))" 
Colors<3, 2> = "Vertical(Gradient(S C S=100 L=90, S C S=100 L=80), Gradient(S C S=100 L=75, S C S=100 L=80))" 
Colors<4, 1> = "Gray" 
Colors<4, 2> = "Vertical(Gradient(Gray L=90, Gray L=80), Gradient(Gray L=75, Gray L=80))" 
rv = Set_Property(@Window:".OLE_TAB", "OLE.TabColors[All]", Colors) 
rv = Set_Property(@Window:".OLE_TAB", "OLE.AllowXPTheme", 0)

See Also

AllowXPTheme