CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: property pages

  1. #1
    Join Date
    Jun 1999
    Posts
    123

    property pages

    I have a program that uses CProperty Pages for Tab control. Here is my initialization code:

    CTrinary *pMyPropSheet;
    CAlpha *pMyPage2;
    CCode *pMyPage3;

    pMyPropSheet = new CTrinary("Trinary");
    pMyPage2 = new CAlpha;
    pMyPage3 = new CCode;
    pMyPropSheet->AddPage(pMyPage2);
    pMyPropSheet->AddPage(pMyPage3);
    pMyPropSheet->DoModal();




    I want to get rid of the four buttons at the bottom, the OK, Cancel, Apply, and Help. But I have no clue how to do this. Please give me step by step instructions because I am not very experienced. Thanks.

    Take a look at a pic of my program to see what I mean please. I am also trying to add a minimize button to the top bar and trying to get the default button (it's the convert to code button in the pic) to work. Please help me with any of these.

    http://www.geocities.com/SiliconVall...036/helpme.jpg


  2. #2
    Join Date
    May 1999
    Location
    Paris, France
    Posts
    216

    Re: property pages

    Before the DoModal :

    pMyPropSheet->m_psh.dwFlags |= PSH_NOAPPLYNOW; // No Apply Button
    pMyPropSheet->m_psh.dwFlags |= ~PSH_HASHELP; // No Help Button




    To remove the OK and Cancel Buttons, you should create a class CMyPropSheet which inherates from CPropertySheet,
    You add the method OnInitDialog and you do

    BOOL CAppliCustomizeSheet::OnInitDialog()
    {
    BOOL bResult = CPropertySheet::OnInitDialog();
    GetDlgItem (IDOK)->ShowWindow (SW_HIDE);
    GetDlgItem (IDCANCEL)->ShowWindow (SW_HIDE);

    return bResult;
    }




    Does this help you ?


  3. #3
    Join Date
    Jun 1999
    Posts
    123

    Re: property pages

    Of the top two lines of code, the first line works but not the second, so I still can't get rid of the help button.


  4. #4
    Join Date
    May 1999
    Posts
    12

    Re: property pages

    I think you have to do the same thing in the propery page dialog.

    eg.

    CMainSettings::CMainSettings() : CPropertyPage(CMainSettings::IDD)
    {
    //{{AFX_DATA_INIT(CMainSettings)
    //}}AFX_DATA_INIT
    m_psp.dwFlags &= ~PSP_HASHELP;
    }



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured