Tabcontrol controls gone when new tab added
Hi, I'm making a tabcontrol that programatically adds a textbox to each tab. The following code I used works, but the problem with it is that every time a new tab page is created, the textbox is missing from the previous tab pages. Why and how can I fix that?
TextBox tb = new TextBox();
TabPage Tab = new TabPage();
tb.Dock = DockStyle.Fill;
Tabs.TabPages.Add("Untitled.asm");
Tabs.TabPages[Tabs.TabCount - 1].Controls.Add(tb);
Tabs.SelectedIndex = Tabs.TabCount - 1;