Solved

How do I change the caption on the Next and Back buttons of the CPropertySheet derived class?

Posted on 2012-03-24
2
1,810 Views
Last Modified: 2013-11-20
Hi ,
How do I change the caption on the next and Nack buttons of the CPropertySheet derived class? I suppose I can change the caption of Apply , OK , Cancel or Finish buttons using their IDs IDAPPY, IDOK, IDCANCEl etc.. what about Next and Back buttons?
0
Comment
Question by:madhav119
[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
2 Comments
 
LVL 5

Accepted Solution

by:
JohnCz earned 185 total points
ID: 37779875
Besides Help button (if used),
Property sheet used as property sheet has OK, Cancel and Apply buttons.
Property sheet used as wizard has Back, Next and Finish buttons.

Ok button has default ID for all OK buttons: IDOK.
Cancel button has default ID for all Cancel buttons: IDCANCEL.
The rest IDs are defined as follows:

Appply: ID_APPLY_NOW
Back: ID_WIZBACK
Next: ID_WIZNEXT
Finish: ID_WIZFINISH

If you are going to change button’s text in CPropertySHeet derived class, use:
	
	CWnd *pWnd = GetDlgItem(ID_WIZBACK);
	pWnd->SetWindowText(_T("No Way Back"));

Open in new window

Do the same for all other buttons you want to change text using appropriate ID.
IF you are going to do it from the page get parent of the page (property sheet) and call SetWindowText as above:
	CPropertySheet* psheet = (CPropertySheet*) GetParent();   
	CWnd *pWnd = psheet->GetDlgItem(ID_WIZBACK);
	pWnd->SetWindowText(_T("No Way Back"));

Open in new window

You can set text for finish button using SetFinishText member of the property sheet but this will hide Back button.
You can do it for example in OnSetActive override of the property page.

HOWEVER I would advice not to do it. In most cases changing default look of the control, makes application not really friendly to the user, causing confusion.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

756 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