I have a couple of questions about tab controls.

1. How do you access the specific tabs and edit their properties? For example if I want to change the name of tabPage1 to "blank".

2. How do you create a new tab page with code? So if I press button1 it creates a new tab?

In addition to 1, there are several other controls that have a similar layout of having to open a new dialogue box to add things (such as list items in a list box). Do you interact with these the same way?

6 Years
Discussion Span
Last Post by Zephyr-

Heres all you need:

private void button1_Click(object sender, EventArgs e)
            //changing name and text property of the tabPage1 (of the tabContgrol1):
            tabPage1.Name = String.Empty;
            tabPage1.Text = "LOOK";

            //creating new tabPage (of th tabControl1):
            int countPages = tabControl1.TabPages.Count;
            TabPage newPage = new TabPage();
            newPage.Name = "tabPage" + countPages;
            newPage.Text = "LOOK - NEW TABPAGE";

about your last question, answer is Yes.
YOu can edit their properties in the code (in runtime) without any problem. Just be careful, that changes wont influence to the rest of th code (jusr be careful, ok?).

Edited by Mitja Bonca: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.