Tabpage Renaming

G

Guest

I have a form that has a
tabcontrol with 5 tabpages. i want to rename the tabpages in runtime.
Actually
i want to right click the tabpage i want to rename and edit the text there
itself. How to acheive it? Any help will be greatlty appreciated.

/Ratan
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Ratan said:
I have a form that has a
tabcontrol with 5 tabpages. i want to rename the tabpages in runtime.
Actually
i want to right click the tabpage i want to rename and edit the text there
itself. How to acheive it? Any help will be greatlty appreciated.

You do so by changing TabPage.Text , of course as you know already this is
not changeable by the user, you have to implement it. A first idea is to
detect a click on the desired tab, you could check it in the selected_index
event. if that is the one you are looking for, create a Textbox with the
correct size/location and edit it, if you remove the border decorations it
will looks like you are editing the name directry in the tabpage.

An alternate option is to extend tabpage with the desired feature.
 
G

Guest

Hello Ignacio Machin,
Thx for idea...
but i want this on mouse right click context menu and as u might be aware
that mouse right click does not select the tabpage, it clicked on so its hard
to check which tabpage user has right clicked.
Same problem i am facing for delete the tabpage on mouse right click also.

/Ratan
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


Ratan said:
Hello Ignacio Machin,
Thx for idea...
but i want this on mouse right click context menu and as u might be aware
that mouse right click does not select the tabpage, it clicked on so its
hard
to check which tabpage user has right clicked.
Same problem i am facing for delete the tabpage on mouse right click also.

Have you look around for a third party control?

Otherwise you would have to implement your own control
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top