Click to See Complete Forum and Search --> : Caption of a PropertyPage


Frederic Naudeau
April 27th, 1999, 08:54 AM
Hi,

I've declared a PropertySheet, and add some pages ( PropertyPage ) into it, like this :


CPropertySheet m_ps;
CMyPropertyPage1 m_pp1;
CMyPropertyPage2 m_pp2;
....
m_ps.AddPage(&m_pp1);
m_ps.AddPage(&m_pp2);




And now I want to change the caption of the pages, so I do :


m_pp1.SetWindowText("New Caption1");
m_pp2.SetWindowText("New Caption2");




But, it doesn't work !! Nothing change !!
Why ?
How can I change the caption of a PropertyPage which is into a PropertySheet ?

Thanks in advance.
Frédéric Naudeau.

Jignesh Patel
April 27th, 1999, 09:35 AM
This is a bit tricky.

If you want to change the text of the pages you actually have to change the text of the tab control.

Let's say you want to change the text for your page1 (m_pp1).

int nIndex = m_ps.GetPageIndex (&m_pp1);

CTabCtrl* pTabCtrl = m_ps.GetTabControl();
TC_ITEM tc_item;
tc_item.mask = TCIF_TEXT;
tc_item.pszText = "New caption";
pTabCtrl->SetItem (nIndex,&tc_item);

HTH

Jignesh

Souad Berrami
April 27th, 1999, 11:18 AM
Hi,
You can use the pszTitle attribute of the CPropertyPage m_psp member
Hope this help
Souad