### TabPane TabPages

Example of using Buttons to add or remove TabPages.
`Sub Process_Globals
...
Private tpMain As TabPane
Private btnTabAdd As Button
Private btnTabRemove As Button
Private btnTabChangeBackgroundColor As Button
...
End Sub`
`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: red;"
tpMain.Tabs.Add(tabpageNew)
End Sub`
'Remove the selected tab = tabpage
`Sub btnTabRemove_Action
Dim idx As Int = tpMain.SelectedIndex
If idx < 0 Then Return
tpMain.Tabs.RemoveAt(idx)
End Sub`
`Sub SetTabPageBackgroundColor
If tpMain.Tabs.Size = 0 Then Return
Dim tp As TabPage = tpMain.SelectedItem
tp.Content.Style = "-fx-background-color: blue;"
End Sub`

Changed: , Category: Visual Designer, File: T6C276M2055.htm, ID: 2055