When inserting tabpages programmatically, the TabPages that are created do not have the same type of color-scheme as one would expect when using the designer. As you can see from the screenshot image below, the “Active” tab’s background color has remained unchanged. How would I programmatically add TabPages to a tab-control so it would behave as if I had added them using the designer?

I have the following code that programmatically inserts tab-pages onto a tab control I have created using WinForms (it is in a foreach loop).
TabPage tPage = new TabPage();
tPage.Text = item.DisplayName + " Options";
FlowLayoutPanel flowPanel = new FlowLayoutPanel();
Label lblLocationField = new Label();
lblLocationField.Text = "Insert into location field:";
CheckBox chkLocationField = new CheckBox();
chkLocationField.Name = "locationField";
flowPanel.Controls.Add(lblLocationField);
flowPanel.Controls.Add(chkLocationField);
tPage.Controls.Add(flowPanel);
this.tabControlConfiguration.Controls.Add(tPage);
It turns out, a new instance of TabPage sets the UseVisualStyleBackColor property to false by default, whereas the designer sets it to “true.”
Therefore, by simply adding the one line below to my code, I was able to get it to render properly!