Quote Originally Posted by HairyMike
You could create a custom tabpage control (which inherits tabpage) and set the colour as it is initialised
I don't see how that is any different from just setting the BackColor after I create the TabPage. I still don't know what color to set it to, since it can be different for every type of Windows, every Theme etc...
I also saw this behaviour in all of my custom tabcontrols (I made quite a few); they all had a gray background. I just set it to White manually though because I was using Vista back then, I didn't even think about users on XP who might find a white background strange (oops!).

Quote Originally Posted by HairyMike
or you could have one created at designtime and made invisible... then create new instance at runtime.
I just tried this but I didn't get it to work correctly, can you explain this further?

I added just a blank TabPage (TabPage1) and changed the code to this:
vb.net Code:
  1. Dim cList As List(Of objDataInfo)
  2.  
  3.     Public Sub New(ByVal n As Integer)
  4.         InitializeComponent()
  5.  
  6.         cList = New List(Of objDataInfo)
  7.  
  8.         'Create tabpages on the fly
  9.         For i As Integer = 1 To n
  10.             Dim t As TabPage = TabPage1
  11.             t.Text = "Objective " & i
  12.             Dim c As objDataInfo = New objDataInfo(i)
  13.             t.Controls.Add(c)
  14.             c.Dock = DockStyle.Fill
  15.             c.Visible = True
  16.  
  17.             tab.TabPages.Add(t)
  18.         Next
  19.         tab.TabPages.Remove(TabPage1)
  20.     End Sub

The BackColor is now correct, but I just see a blank "TabPage 5" (n = 5) 5 times. There is no sign of my control, and only TabPage5 appears (5 times...)

Not very surprising actually since I'm just copying the same tabpage into the TabControl 5 times..?

I probably didn't understand correctly.