Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Buttons missing in modeless CXTResizePropertySheet
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Buttons missing in modeless CXTResizePropertySheet

 Post Reply Post Reply
Author
Message
luinho View Drop Down
Newbie
Newbie


Joined: 20 June 2008
Location: United Kingdom
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote luinho Quote  Post ReplyReply Direct Link To This Post Topic: Buttons missing in modeless CXTResizePropertySheet
    Posted: 20 June 2008 at 11:23am
It looks like this is a bug in the MFC CPropertySheet class itself that does not create the buttons when the propertysheet is modeless (I don't exactly know why someone would not need the buttons just because the dialog is modeless... ), but I would expect the derived CXTResizePropertySheet to be implemented properly and fix this "bug".
Anyway, is there an easy way to create a resizeable modeless property sheet with the OK, CANCEL and HELP buttons using CXTResizePropertySheet ?
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 June 2008 at 1:38pm
Use Google + "How To Create a Modeless CPropertySheet with Standard Buttons"
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
luinho View Drop Down
Newbie
Newbie


Joined: 20 June 2008
Location: United Kingdom
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote luinho Quote  Post ReplyReply Direct Link To This Post Posted: 23 June 2008 at 5:47am
Many thanks Oleg.
 
I got this from the MSDN article
Q146916 - How To Create a Modeless CPropertySheet with Standard Buttons
 

For a modeless CPropertySheet, the Microsoft Foundation Classes (MFC) resize the sheet and hide the standard buttons in the CPropertySheet::OnInitDialog member function. To prevent MFC from doing this, perform the following steps:

Derive a class from CPropertySheet and override the OnInitDialog function.

Set "m_bModeless" to FALSE and remove the WF_CONTINUEMODAL style for "m_nFlags".

Call CPropertySheet::OnInitDialog.

Set "m_bModeless" back to TRUE and add the style WF_CONTINUEMODAL to "m_nFlags".

BOOL CMyPropertySheetClass::OnInitDialog()

{

      BOOL bResult;

      if(this->m_bModal)

      {

            bResult = CPropertySheet::OnInitDialog();

      }

      else

      {

            m_bModeless = FALSE;  

            m_nFlags |= WF_CONTINUEMODAL;

 

            bResult = CPropertySheet::OnInitDialog();

 

            m_bModeless = TRUE;

            m_nFlags &= ~WF_CONTINUEMODAL;

      }

 

return bResult;

}

In addition, if you want to ommit the Aply button, use this in the constructor of the derived property sheet class:

 

      // We don't want to display the apply button

      this->m_psh.dwFlags |= PSH_NOAPPLYNOW;

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.