How to make a tab's name editable in C#?

c#, winforms

Solution

You can dynamically create a text box and place it over the tab area to make the user think they are editing the tab directly. When the text box loses focus you can then put the typed in value into the tabs property.

Problem

So I have a few tabs in the form, and i want it to work like that: When you click on the tab's name, it becomes editable, and when i stop editing it remains with the new name. How would i do that with C# and winforms?

Original source