?
Solved

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

Posted on 2012-03-24
2
Medium Priority
?
1,892 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:
Janusz Czopowik earned 555 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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…

719 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