Solved

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

Posted on 2004-09-14
5
188 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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: 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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

635 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