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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…

770 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