IgnaceMaes / MaterialSkin

Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles.
MIT License
2.84k stars 831 forks source link

Open or Close tabpage #122

Closed baxi2990 closed 7 years ago

baxi2990 commented 7 years ago

Hi good morning , there is some way that can create new tabs and close at runtime?

IgnaceMaes commented 7 years ago

Just like you would with a normal TabControl. Here's an example:

            var runtimeTabPage = new TabPage("Runtime TabPage");
            runtimeTabPage.BackColor = Color.White;

            var runtimeButton = new MaterialRaisedButton();
            runtimeButton.Text = "Added at runtime";
            runtimeTabPage.Controls.Add(runtimeButton);

            materialTabControl1.TabPages.Add(runtimeTabPage);

And to delete:

            materialTabControl1.TabPages.Remove(runtimeTabPage);