Solved

How to put Buttons on a modeless property sheet in MFC?

Posted on 2001-08-20
7
428 Views
Last Modified: 2013-11-20
I am not able to put some buttons on a modeless property shett having 2 property pages. I am trying to add button at the bottom of the modeless property sheet . I have tryied doing GetWindowRect and MoveWindow in OnCreate of the propertysheet as suggested in the help.
0
Comment
Question by:uttamabhyankar
7 Comments
 

Author Comment

by:uttamabhyankar
ID: 6406678
Please give me the answer ASAP.
thanks,
uttam
0
 
LVL 12

Expert Comment

by:migel
ID: 6407085
Hi!
did you look at www.codeguru.com property sheet section?
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6407183
Handle OnInitDialog and


BOOL CMySheet::OnInitDialog()
{
     CPropertySheet::OnInitDialog();
     
     
     
     RECT rc;
     GetWindowRect (&rc);
     
     rc.bottom += 40;
     
     MoveWindow (rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
     
     ScreenToClient (&rc);
     
     m_button.Create ("Press me",
          WS_CHILD | WS_VISIBLE | WS_TABSTOP,
          CRect (5, rc.bottom-35, 80, rc.bottom-10),
          this, 1000);
     
     return TRUE;  // return TRUE unless you set the focus to a control
     // EXCEPTION: OCX Property Pages should return FALSE
}

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 9

Accepted Solution

by:
ShaunWilde earned 100 total points
ID: 6407184
you may need to move the message filter for your property sheet class to dialog
0
 

Expert Comment

by:thebigone
ID: 6409218
You can also embed the propsheet in a frame (I asked for that 2 weeks ago ...)

Refer to :


http://support.microsoft.com/support/kb/articles/Q234/5/45.ASP
0
 
LVL 1

Expert Comment

by:Tim_Musschoot
ID: 6409503
There is an example of adding buttons to a modeless Dialog at the microsoft MSDN (look online(!) for CWaitDialog).  The method is equal for a property sheet.

Tim Musschoot
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9521280
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: ShaunWilde

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

863 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

23 Experts available now in Live!

Get 1:1 Help Now