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;
Tabcontrol controls gone when new tab added
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Manikavelu VelayuthamRank #413 · 6K reputationPosted Sep 27, 2010, 4:09 AM EDT