I think this is what you are looking to do?

tabControl1.TabPages[0].Text = "the test of my tab";

It appears you are changing your tabcontrol property and not the tabPage of your tabcontrol.

If you are accessing by c# code then use the above. You can also enter the name opposed to the (int)Id of the tab but I would use ID as it won't affect you changing the name.

If you are doing this through a GUI then be sure to click the body of the tab page and not the outline of the tab control.

>Why i can't write a text in the box of a tab ?

This is not an editable area. It is a container region in which you may add other controls (textboxes, buttons, etc).

adatapost and SharpJohnnyG are both correct, depending on what you meant. Can you clarify your question. Are you trying to alter the text that appears above each page (eg "tabPage1") or are you trying to place text inside the tab page itself.

If its the first, then what SharpJohnnyG said is correct, you need to alter the text proeprty of the pages not the containing control. Either click on the page itself then alter its text in the property window, or click on the container and then access its TabPages Colelction from the property window (see image tabpages.JPG).

If you want to add text to the body of the page then (as adatapost said) the tab page is a container, you need to add controls to it. So to add text you can add a label or textbox to the page.

Attachments tabpages.JPG 94.65 KB
This article has been dead for over six months. Start a new discussion instead.