Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can I change the caption of a property page?

Can I change the caption of a property page?

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
10 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ElizabethC
    wrote on last edited by
    #1

    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

    G B 2 Replies Last reply
    0
    • E ElizabethC

      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

      G Offline
      G Offline
      godzooky
      wrote on last edited by
      #2

      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 ); }

      1 Reply Last reply
      0
      • E ElizabethC

        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

        B Offline
        B Offline
        BadJerry
        wrote on last edited by
        #3

        This is one of the constructors of CPropertyPage: CPropertyPage( UINT nIDTemplate, UINT nIDCaption = 0 ) Simply pass the relevant string identifier as the second parameter

        E 1 Reply Last reply
        0
        • B BadJerry

          This is one of the constructors of CPropertyPage: CPropertyPage( UINT nIDTemplate, UINT nIDCaption = 0 ) Simply pass the relevant string identifier as the second parameter

          E Offline
          E Offline
          ElizabethC
          wrote on last edited by
          #4

          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

          B 1 Reply Last reply
          0
          • E ElizabethC

            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

            B Offline
            B Offline
            BadJerry
            wrote on last edited by
            #5

            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!

            E 1 Reply Last reply
            0
            • B BadJerry

              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!

              E Offline
              E Offline
              ElizabethC
              wrote on last edited by
              #6

              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

              B 1 Reply Last reply
              0
              • E ElizabethC

                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

                B Offline
                B Offline
                BadJerry
                wrote on last edited by
                #7

                Do not add the constructor, replace it...

                E 1 Reply Last reply
                0
                • B BadJerry

                  Do not add the constructor, replace it...

                  E Offline
                  E Offline
                  ElizabethC
                  wrote on last edited by
                  #8

                  Thank you. It works. Eilzabeth

                  B 1 Reply Last reply
                  0
                  • E ElizabethC

                    Thank you. It works. Eilzabeth

                    B Offline
                    B Offline
                    BadJerry
                    wrote on last edited by
                    #9

                    Cool... I started to doubt! By the way, your sig has a spelling mistake...

                    E 1 Reply Last reply
                    0
                    • B BadJerry

                      Cool... I started to doubt! By the way, your sig has a spelling mistake...

                      E Offline
                      E Offline
                      ElizabethC
                      wrote on last edited by
                      #10

                      Got it fixed. Just realized that I need to update my profile. Elizabeth

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups