Brandon
Brandon

Reputation: 161

How do I add a tab to a given tabcontrol.?

I am using VS2010 (C#) and I want to create a button that creates a new tab. I already have a tabControl container created. How would I do this?

Upvotes: 0

Views: 87

Answers (1)

svick
svick

Reputation: 244777

Moved here from Brandon's solution in the question:

string title = "TabPage " + (tabControl1.TabCount + 1).ToString();
TabPage myTabPage = new TabPage(title);
tabControl1.TabPages.Add(myTabPage);

Upvotes: 1

Related Questions