CPropertySheet problem

  • Thread starter Thread starter Stephen
  • Start date Start date
S

Stephen

Hi,

I have created a NON-MODULE CPropertySheet in a form. And I have added
several CPropertyPage to the sheet.

There's a runtime error where I call SetWindowText of CProertyPage which is
not the first one. I was told that the page is not a window (hWnd = NULL).
Only the first page can use SetWindowText.

How can I change the tab name of the pages at rumtime? BTW, I can set the
captions of the pages in design time.

And I was failed to get the tab pointer by calling GetTabCtrl.

Thanks.
 
Done.
before propertysheet.create
page1.m_psp.dwFlags |= PSP_USETITLE;
page1.m_psp.pszTitle = "....";
.....

after activing of page£º
override CPropertyPage::OnSetActive
call GetParent() to get PropertySheet pointer, then call SetWindowText
 
There's a runtime error where I call SetWindowText of CProertyPage which is
not the first one. I was told that the page is not a window (hWnd = NULL).

Stephen,

By default the pages aren't created until you first switch to them. If
you need the pages to exist, set the PSP_PREMATURE flag for the pages.

Dave
 
Back
Top