471,319 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Tabpage Renaming

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
Feb 10 '06 #1
4 9893
Hi,

"Ratan" <Ra***@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
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.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 10 '06 #2
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
"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

"Ratan" <Ra***@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
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.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Feb 13 '06 #3
Hi,
"Ratan" <Ra***@discussions.microsoft.com> wrote in message
news:8F**********************************@microsof t.com...
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
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 13 '06 #4
Have you seen my "Associate a ContextMenu with the TabItem headers of a
Tabcontrol." example?
http://www.dotnetrix.co.uk/tabcontrols.html

If it's not exactly what you want, it should be easy enough to modify.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Ratan" <Ra***@discussions.microsoft.com> wrote in message
news:8F**********************************@microsof t.com...
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
"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

"Ratan" <Ra***@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
>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.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Feb 14 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by TMB333 | last post: by
2 posts views Thread by meh | last post: by
3 posts views Thread by Cynthia | last post: by
8 posts views Thread by touf | last post: by
6 posts views Thread by ray well | last post: by
6 posts views Thread by =?Utf-8?B?U2hhcm9u?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.