472,951 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,951 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 10101
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: TMB333 | last post by:
I've researched as much as I can on the issue, but I've not found any clearly defined statement that acknowledges that the Hide method for a TabPage object just doesn't do what it's supposed to do....
9
by: Robb Gilmore | last post by:
Hello, This is probably an easy one, but I have not been able to figure it out so far. I have a tab control on a windows forms app. Depending on some business logic, I need to hide/show some...
2
by: JG | last post by:
Hi, I have a windows form with a TabControl on it. It has 3 tabpages on it. I have also coded a button that is supposed to 'add' a new tabpage. The code in that clicked event looks like this:...
2
by: meh | last post by:
I'm not sure if I have the right concept going. I am making a custom TabPage and executing it from a button click event. It works fine I'm just thinking I might be missing the finer points of the...
1
by: RA | last post by:
Hi 1) I want to create a TabPage class in design mode - how do I do it? What type of project should I use? Is it going to be a custom control? 2) I have a TabControl that I would like to add to...
3
by: Cynthia | last post by:
I knew that "Hide" doesn't work with Tabpage if I want to hide it. I should use Remove/Add. But I have some other controls in the tabpage which I don't want to use code to dynamiclly create them....
8
by: touf | last post by:
Hi, I've a tabcontrol that contains many similar tabpages (exactly the same structure with different information), the tabpages number isn't known in the design time it depends of the data. Is...
6
by: ray well | last post by:
i want a user to be able to change tab pages thru the keyboard, i tried entering the TabPage.text as '&1 Names', "&2 Addresses', etc., so that the user can change pages by type ALT 1, ALT 2, on the...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello gurus, I want to have a Form with a TabControl, this TabControl will contain TabPage that has controls in it, this TabPage is prepared at design time. I want in runtime to duplicate the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.