Solved

How do I change the label/title of a Tab?

Posted on 2004-09-14
5
187 Views
Last Modified: 2013-11-20
I have a CPropertySheet that contains several CPropertyPage instances. The labels of each tab are defined in my resource file. I need to change the label of one of the tabs at runtime. How do I do this?

thanks
Paul
0
Comment
Question by:PMH4514
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 14

Expert Comment

by:wayside
ID: 12059144
The constructors for CPropertyPage all take a resource id of a string to use in the tab. You can have your derived class constructors pass that id along to the CProprtyPage constructor. This id can be calculated at runtime.


0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 50 total points
ID: 12062268
      CString s("Hello world");
      TCITEM tabItem;
      tabItem.mask = TCIF_TEXT;

      tabItem.pszText = s.GetBuffer(0);
      pSheet->GetTabControl()->SetItem(2, &tabItem);  /pSheet is a pointer to your property sheet, this changes the text of the third tab - zero based indexing
0
 

Author Comment

by:PMH4514
ID: 12063893
AndyAinscow : would I place that code within my property sheet or within the page whose tab I need to change?
0
 

Author Comment

by:PMH4514
ID: 12063953
oh,  nevermind.. I put it in OnInitDialog() of my property sheet, worked perfect. Thanks!
0
 

Author Comment

by:PMH4514
ID: 12063955
wayside - I think your solution would work as well, but Andy provided the exact answer to my question. thanks though
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to match SAS datasets by multiple key variables and then rename and create new variables? 2 117
sum28 challenge 31 117
twoTwo  challenge 35 119
I could not set window to top 4 62
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question