Can I change the caption of a property page?
-
I want to use the same dialog resource for three different tabs in a property sheet because each tab has the same appearance, e.g. one list control. Kind of data loaded to the list will be based on which tab is selected. Can this be done? Eilzabeth
-
I want to use the same dialog resource for three different tabs in a property sheet because each tab has the same appearance, e.g. one list control. Kind of data loaded to the list will be based on which tab is selected. Can this be done? Eilzabeth
are you asking how to dynamically set the text on the property page tabs? if so, see below code. void CMYPropertySheet::SetTabNames( const CString& page1Name, const CString& page2Name, const CString& page3Name ) { TC_ITEM tcItem; tcItem.mask = TCIF_TEXT; tcItem.pszText = (LPTSTR)((LPCTSTR)page1Name); GetTabControl()->SetItem( 0, &tcItem ); tcItem.pszText = (LPTSTR)((LPCTSTR)page2Name); GetTabControl()->SetItem( 1, &tcItem ); tcItem.pszText = (LPTSTR)((LPCTSTR)page3Name); GetTabControl()->SetItem( 2, &tcItem ); }
-
I want to use the same dialog resource for three different tabs in a property sheet because each tab has the same appearance, e.g. one list control. Kind of data loaded to the list will be based on which tab is selected. Can this be done? Eilzabeth
-
This is one of the constructors of CPropertyPage: CPropertyPage( UINT nIDTemplate, UINT nIDCaption = 0 ) Simply pass the relevant string identifier as the second parameter
I tried Add(&m_testpage("test")) at the property sheet class's constructor, but the compiler did not like it. It says term does not evaluate to a function. May be you can tell me where to fix. I have this in the property page: IMPLEMENT_DYNCREATE(CInboxPropPage, CPropertyPage) CInboxPropPage::CInboxPropPage() : CPropertyPage(CInboxPropPage::IDD) { //{{AFX_DATA_INIT(CInboxPropPage) //}}AFX_DATA_INIT } Eilzabeth
-
I tried Add(&m_testpage("test")) at the property sheet class's constructor, but the compiler did not like it. It says term does not evaluate to a function. May be you can tell me where to fix. I have this in the property page: IMPLEMENT_DYNCREATE(CInboxPropPage, CPropertyPage) CInboxPropPage::CInboxPropPage() : CPropertyPage(CInboxPropPage::IDD) { //{{AFX_DATA_INIT(CInboxPropPage) //}}AFX_DATA_INIT } Eilzabeth
ElizabethC wrote: but the compiler did not like it Yeah the buggers have no sense of humour! First create your string in the .rc file (Call it IDS_MYSTRING "String") in InboxPropPage.h, change your contructor to be CInboxPropPage(UINT nCaptionId=0); in InboxPropPage.cpp, change your contructor to be CInboxPropPage::CInboxPropPage(UINT nCaptionId) : CPropertyPage(CInboxPropPage::IDD,nCaptionId) When you create the sheet with its pages, write CInboxPopPage pagInbox(IDS_MYSTRING); and you should be in business! Good luck!
-
ElizabethC wrote: but the compiler did not like it Yeah the buggers have no sense of humour! First create your string in the .rc file (Call it IDS_MYSTRING "String") in InboxPropPage.h, change your contructor to be CInboxPropPage(UINT nCaptionId=0); in InboxPropPage.cpp, change your contructor to be CInboxPropPage::CInboxPropPage(UINT nCaptionId) : CPropertyPage(CInboxPropPage::IDD,nCaptionId) When you create the sheet with its pages, write CInboxPopPage pagInbox(IDS_MYSTRING); and you should be in business! Good luck!
I added the contructor and tried to compile the code, but getting another error message: error C2668: 'CInboxPropPage::CInboxPropPage' : ambiguous call to overloaded function It was complaining on the IMPLEMENT_DYNCREATE line: IMPLEMENT_DYNCREATE(CInboxPropPage, CPropertyPage) CInboxPropPage::CInboxPropPage() : CPropertyPage(CInboxPropPage::IDD) { //{{AFX_DATA_INIT(CInboxPropPage) m_message_flag = "0"; //}}AFX_DATA_INIT } CInboxPropPage::CInboxPropPage(UINT nIDCaption) : CPropertyPage(CInboxPropPage::IDD, nIDCaption) { //{{AFX_DATA_INIT(CInboxPropPage) //}}AFX_DATA_INIT } Eilzabeth
-
I added the contructor and tried to compile the code, but getting another error message: error C2668: 'CInboxPropPage::CInboxPropPage' : ambiguous call to overloaded function It was complaining on the IMPLEMENT_DYNCREATE line: IMPLEMENT_DYNCREATE(CInboxPropPage, CPropertyPage) CInboxPropPage::CInboxPropPage() : CPropertyPage(CInboxPropPage::IDD) { //{{AFX_DATA_INIT(CInboxPropPage) m_message_flag = "0"; //}}AFX_DATA_INIT } CInboxPropPage::CInboxPropPage(UINT nIDCaption) : CPropertyPage(CInboxPropPage::IDD, nIDCaption) { //{{AFX_DATA_INIT(CInboxPropPage) //}}AFX_DATA_INIT } Eilzabeth
-
Thank you. It works. Eilzabeth
-
Thank you. It works. Eilzabeth
-
Got it fixed. Just realized that I need to update my profile. Elizabeth