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
Solved

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

Posted on 2004-09-14
5
185 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
  • 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
iSeries FTP Exit Program 8 145
if loop in java 3 151
sum28 challenge 31 115
Fibonacci challenge 11 132
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

790 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