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,820 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…

737 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