Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

adding buttons to the Propertysheet.

Posted on 1999-06-22
7
Medium Priority
?
164 Views
Last Modified: 2013-11-20
i have a class CMypropertysheet with 4 pages .
i can design the pages by changing their dialod boxes but i can´t change the design of the Propertysheet dialog ,that contain my 4 pages.
how can i add buttons to a dialog Mypropertysheet and how can i delete the buttons OK or CANCEL for example.
there is no Dilog for the propertysheet in the ressources  
0
Comment
Question by:khf
[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
  • 4
  • 3
7 Comments
 
LVL 3

Expert Comment

by:Shay050799
ID: 1307684
u are wasting your points
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 1307685
Adding buttons is not a simple process. But removing or hiding button will be simple trick. There is no resource associated with property sheet. But we can make use of virtual functions of dialog box. Make use of InInitdialog function.
the IDs of butons on the sheet are
IDOK, IDCANCEL, ID_APPLY_NOW

BOOL CMyPropSheet::OnInitDialog ()
{
BOOL bResult = CPropertySheet::OnInitDialog ();
CWnd *pWnd = GetDlgItem (IDOK);
ASSERT (NULL != pWnd);
pWnd->ShowWindow (SW_HIDE);

pWnd = GetDlgItem (IDCANCEL);
ASSERT (NULL != pWnd);
pWnd->ShowWindow (SW_HIDE);

// Lets chage the caption of apply button.

pWnd = GetDlgItem (ID_APPLY_NOW);
ASSERT (NULL != pWnd);
pWnd->SetWindowText (_T ("My apply"));

return bResult;
}

For adding more buttons, either you do the hard way of caluclating the layout of property sheet and adding the buttons at run time at required locations.
Or simple way is make use of mehtod of embedding property sheets on dialog boxes. For this you can have a look at the examples posted on codeguru.com site.

Cheers!
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 1307686
khf,
did it work for u?

and shay....
whats the meaning of ur answer. no point giving up on these minor MFC issues :)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Accepted Solution

by:
naveenkohli earned 100 total points
ID: 1307687
KHF...
You did not mention while rejecting the answer, if the method i told you, worked or not ....
0
 
LVL 3

Expert Comment

by:Shay050799
ID: 1307688
he never comment he rejected my answer elsewhere without say nothing, that why i answer nothing here...
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 1307689
shay..
i noticed that.. may  be he wants free answers :)
0
 
LVL 3

Expert Comment

by:Shay050799
ID: 1307690
i m not going to help him, untill he changed his attitude, this web site is suppose to help us to improve ourself, by commenting u can understand if u wrong or right

and he just thinking about himself

sorry
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

670 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