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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. change title of a tab page.

change title of a tab page.

Scheduled Pinned Locked Moved C / C++ / MFC
question
8 Posts 2 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.
  • F Offline
    F Offline
    FISH786
    wrote on last edited by
    #1

    I have a List control on a tab page. I would like to change the text of the tab page depending on the row the user has selected. How do i do that? EG...m_tabCtrl.addNewPage("Page 2",&m_page2); Now the Control List has rows which say "Group 1", "Group 2" ...."Group X". What function would Change "Page 2" to now read "Group X". Thanks a Million.

    _ 1 Reply Last reply
    0
    • F FISH786

      I have a List control on a tab page. I would like to change the text of the tab page depending on the row the user has selected. How do i do that? EG...m_tabCtrl.addNewPage("Page 2",&m_page2); Now the Control List has rows which say "Group 1", "Group 2" ...."Group X". What function would Change "Page 2" to now read "Group X". Thanks a Million.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      Use CTabCtrl::SetItem and change the pszText member to the required text string.

      «_Superman_» I love work. It gives me something to do between weekends.

      F 1 Reply Last reply
      0
      • _ _Superman_

        Use CTabCtrl::SetItem and change the pszText member to the required text string.

        «_Superman_» I love work. It gives me something to do between weekends.

        F Offline
        F Offline
        FISH786
        wrote on last edited by
        #3

        Thank you. But being new now the question is how do I reference it from the property page?

        _ 1 Reply Last reply
        0
        • F FISH786

          Thank you. But being new now the question is how do I reference it from the property page?

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          Use CTabCtrl::GetCurSel to get the current selected tab and pass this as the first parameter to CTabCtrl::SetItem.

          «_Superman_» I love work. It gives me something to do between weekends.

          F 1 Reply Last reply
          0
          • _ _Superman_

            Use CTabCtrl::GetCurSel to get the current selected tab and pass this as the first parameter to CTabCtrl::SetItem.

            «_Superman_» I love work. It gives me something to do between weekends.

            F Offline
            F Offline
            FISH786
            wrote on last edited by
            #5

            thank you. But that part I understand. I am lost in trying to reference the control. Dialog based application: class CDialogTest In here i have the tab contol : class CibTabCntl. variable m_tabCntrl. in Cibtabcntl-> I added a member funtion as CIbTabCtrl::SetTabTitle(.....). Property Page class CPropertyPage2 or CPropertyPage1 How do I reference it from CPropertyPage2 or CPropertyPage1.

            _ 1 Reply Last reply
            0
            • F FISH786

              thank you. But that part I understand. I am lost in trying to reference the control. Dialog based application: class CDialogTest In here i have the tab contol : class CibTabCntl. variable m_tabCntrl. in Cibtabcntl-> I added a member funtion as CIbTabCtrl::SetTabTitle(.....). Property Page class CPropertyPage2 or CPropertyPage1 How do I reference it from CPropertyPage2 or CPropertyPage1.

              _ Offline
              _ Offline
              _Superman_
              wrote on last edited by
              #6

              There is no CPropertyPage for a tab control. CPropertyPage is a class that is associated with CPropertySheet.

              «_Superman_» I love work. It gives me something to do between weekends.

              F 1 Reply Last reply
              0
              • _ _Superman_

                There is no CPropertyPage for a tab control. CPropertyPage is a class that is associated with CPropertySheet.

                «_Superman_» I love work. It gives me something to do between weekends.

                F Offline
                F Offline
                FISH786
                wrote on last edited by
                #7

                Thanks. when I compile i am getting an error error C2352: 'CPropertySheet::GetTabControl' : illegal call of non-static member function

                _ 1 Reply Last reply
                0
                • F FISH786

                  Thanks. when I compile i am getting an error error C2352: 'CPropertySheet::GetTabControl' : illegal call of non-static member function

                  _ Offline
                  _ Offline
                  _Superman_
                  wrote on last edited by
                  #8

                  Oh Boy!!! :doh:

                  CPropertySheet object;
                  object.GetTabControl();

                  «_Superman_» I love work. It gives me something to do between weekends.

                  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