how to change the title of a property page 
Author Message
 how to change the title of a property page

Hi,

Could someone shows me how to change the title of
a property page in a property sheet?  I called the
page's SetWindowText() in the page's InitDialog()
but the title is still the one in the .rc file.
If this is done in the sheet's constructor, the
program crashes.  Please help.  Thanks.

Tony



Mon, 09 Aug 2004 06:32:09 GMT  
 how to change the title of a property page


Quote:
> Hi,

> Could someone shows me how to change the title of
> a property page in a property sheet?  I called the
> page's SetWindowText() in the page's InitDialog()
> but the title is still the one in the .rc file.
> If this is done in the sheet's constructor, the
> program crashes.  Please help.  Thanks.

Take a look at:

CPropertySheet::GetTabCtrl()

Then use the pointer returned to change the title with:

SetItem()

If you need more info take a look on MSDN.

HTH,

Dana



Mon, 09 Aug 2004 06:57:04 GMT  
 how to change the title of a property page
May,

You have to set it in the tab control for the property sheet.  Here's some
quick code that should work for you...  The tabs are indexed from left to
right starting at zero.

 CPropertySheet *p = (CPropertySheet *)GetParent();
 CTabCtrl *t = p->GetTabControl();
 TCITEM item;

 // set a mask to tell it to get the text for the item
 item.mask = TCIF_TEXT;
 t->GetItem(2,&item);
 item.pszText = "Tom";
 // set the new text in the control
 t->SetItem(2, &item);

HTH,

Tom


Quote:
> Hi,

> Could someone shows me how to change the title of
> a property page in a property sheet?  I called the
> page's SetWindowText() in the page's InitDialog()
> but the title is still the one in the .rc file.
> If this is done in the sheet's constructor, the
> program crashes.  Please help.  Thanks.

> Tony



Mon, 09 Aug 2004 07:17:33 GMT  
 how to change the title of a property page
An easier way to change PropertyPage's title is as follows:

CMyPropPage::CMyPropPage(**)
{
     m_psp.dwFlags |= PSP_USETITLE;
      m_psp.pszTitle = "My New Title";

Quote:
}

Or you can have it done in OnInitDialog().


Quote:
> Hi,

> Could someone shows me how to change the title of
> a property page in a property sheet?  I called the
> page's SetWindowText() in the page's InitDialog()
> but the title is still the one in the .rc file.
> If this is done in the sheet's constructor, the
> program crashes.  Please help.  Thanks.

> Tony



Mon, 09 Aug 2004 10:03:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. help needed changing Property Page titles dynamically

2. How can I change pages in property page?

3. Change fonts in a property pages of property sheet

4. Setting property page title

5. Bold Property Page Titles

6. Large Title in Property Page

7. Titles of property pages.

8. Property Page Title...

9. property page title

10. How to add bitmap to Property page title?

11. Overriding the Property Page Title in Wizard mode

12. Property Page Title for an OCX

 

 
Powered by phpBB® Forum Software