CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Location
    London, England
    Posts
    42

    How do I initialise all pages in a property sheet?

    All my Property Pages change their tab caption in InitDialog(), but the InitDialog only gets run when it is first displayed... How do I overcome this "problem"?


  2. #2
    Join Date
    May 1999
    Posts
    116

    Re: How do I initialise all pages in a property sheet?

    In the resource editor, change the caption of the dialog that is used for the page to whatever caption you initially require.

    If the names are not known at design time, you should be able to use the CPropertyPage::m_psp.pszTitle item. Not sure if this overrides the dlg title or not, but it should be worth a try.

    NOTE: SetWindowText on the propertypage will not work ( and will more than likely cause a CPF) as the actual dialog has not been created yet).


  3. #3
    Join Date
    May 1999
    Posts
    10

    Re: How do I initialise all pages in a property sheet?

    As I know thre are two ways of making OnInitDialog for each property page be
    called when property sheet is displayed.

    1.
    Call for each page SetActive method in OnInitDialog for CPropertySheet derived object.
    Just override CYourPropSheet::OnInitDialog() and call SetActive() for every page
    you have (better to do it in the loop, going from the last one to the first).

    2.
    Before adding the pages to the property sheet add the PSP_PREMATURE to the
    dwFlags member of the m_psp data member of the page.

    MyPropPage.m_psp.dwFlags |=3D PSP_PREMATURE;

    With this flag every page will receive the WM_INITDIALOG a soon as the sheet's
    DoModal is called.

    I hope it will help.




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