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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

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…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now