I have tested it. When a page is removed, it is destroied, as well as all the controls on it. They have to then be recreated when the pages are added back in. I created an array of pages, added controls, then can add or remove those pages to the tab control.
Here is some of the code I used to created the pages and put them in an array.
Public Sub setTabPages()
Dim intX As Int16
For intX = 0 To 19
Dim myTabPage As New TabPage
notePages(intX) = myTabPage
Next
End Sub
Public Sub setTxtBoxes()
Dim intX As Int16
For intX = 0 To 19
Dim myTextBox As New TextBox
txtBoxes(intX) = myTextBox
AddHandler txtBoxes(intX).TextChanged, AddressOf txtBoxes_TextChanged
AddHandler txtBoxes(intX).MouseMove, AddressOf txtBoxes_MouseMove
notePages(intX).Controls.Add(txtBoxes(intX))
txtBoxes(intX).Dock = DockStyle.Fill
txtBoxes(intX).Multiline = True
txtBoxes(intX).ScrollBars = ScrollBars.Vertical
noteSaved(intX) = False
noteName(intX) = "Un-named"
Next
End Sub
Becca
Somtimes, the easy answer is the hardest to find.
Still under construction ...