Dynamically changing tab labels in CPropertySheet

I want to create 2 property pages from the same class and template because the settings they show are basically the same.

CCPUSettingsSheet sheet;
CCPUSettingsPage cpucore1, cpucore2;
sheet.AddPage(&cpucore1);
sheet.AddPage(&cpucore2);

      

The only problem is that they get the same tab-label text, which is the title field in their resource template. I need to assign different text to each one.

+3


source to share


1 answer


Assuming that it CCPUSettingsPage

comes from CPropertyPage , you can use its public m_psp to access its underlying PROPSHEETPAGE structure . From there, you can write something like:



cpucore1.m_psp.dwFlags |= PSP_USETITLE;
cpucore1.m_psp.pszTitle = "First Tab";

cpucore2.m_psp.dwFlags |= PSP_USETITLE;
cpucore2.m_psp.pszTitle = "Second Tab";

      

+5


source







All Articles