473,804 Members | 3,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10164
Hi,

"Ratan" <Ra***@discussi ons.microsoft.c om> wrote in message
news:18******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:18******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:8F******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:8F******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:18******** *************** ***********@mic rosoft.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
13579
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. This appears to be a bug, or maybe I'm using it incorrectly? TabPage.Hide should hide the referenced TabPage object, should it not? Do I have to 'refresh' the Windows form somehow? The closest I've come to any means of hiding a TabPage from...
9
883
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 of the individual tabs. The tab page has no "visible" property. The tabpage class has a "hide" method, but this does not seem to make it disappear. I have been able to remove them via something like this:
2
1689
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: tabPage tpNew = new TabPage("TabPage4"); this.tabControl1.TabPages.Add(tpNew); tpNew.Controls.Add(this.label1);
2
2088
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 c# language. If not maybe I'm starting to catch on. Would like comments...better???...simpler???... Here is the code.... tia meh // Build New Tab Page // string title = "tabPage" + (tabControl1.TabCount + 1).ToString();
1
7652
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 it the TabPage created in step 1. I don't want to draw the TabPage on the Tabcontrol in design mode, but to have a few TabPage controls that I candynamicaly load to the TabControl at runtime. Thanks
3
3486
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. If I use remove to remove that tabpage and later use add to add it back in, I have to write code to create all the controls inside that tabpage, otherwise it will be a blank page. What can I do to avoid it? Thank you for your time and help.
8
12070
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 there a way to clone ( copy the structure) a tabpage to create anew one by code? thanks.
6
4571
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 keyboard. but the text showing up in the tab is '&1 Names' instead of the '1' being underlined, and being able to be accessed thru the keyboard. how can i get a user to be able to change from TabPage to TabPage thru the keyboard? i find it...
6
12935
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 TabPage that wad made during the design time together with all its controls, but without the controls data. Is there an easy way to do that?
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10076
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.