### Set Background Color TabPage

Various options, to set the background color of a TabPage, set the style of the Content property of the TabPage.
Example Set Background Color selected TabPage
'Set the color of the tabpage. Uses the CSSUtils library.
'Example SetTabPageBackgroundColor(fx.Colors.Cyan)
`Sub SetTabPageBackgroundColor(color As Paint)
Log("TabPage set background color")
If tpMain.Tabs.Size = 0 Then Return
Dim tp As TabPage = tpMain.SelectedItem
tp.Content.Style = $"-fx-background-color: ${CSSUtils.ColorToHex(color)};"$
End Sub`
Example Set Background Color when adding a Tab via Code
'Add a new tab = TabPage to the TabPane
`Sub btnTabAdd_Action
Dim tabpageNew As TabPage
tabpageNew.Initialize
tabpageNew.Id = "tabpage" & (tpMain.Tabs.Size + 1)
tabpageNew.Text = "Tab " & (tpMain.Tabs.Size + 1)
'Set the background color of the anchorpane of the new tab
Dim ap As AnchorPane
ap.Initialize("")
tabpageNew.Content = ap
ap.Style = "-fx-background-color: blue;"
tpMain.Tabs.Add(tabpageNew)
End Sub`

Changed: , Category: TabPage and TabPane, File: T6C260M1915.htm, ID: 1915