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. Hiding a CPropertyPage at runtime

Hiding a CPropertyPage at runtime

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
7 Posts 4 Posters 0 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.
  • T Offline
    T Offline
    tabor25
    wrote on last edited by
    #1

    Hello, I need to know how to hide a CPropertyPage at runtime in my app. I thought that it could be done by first removing all the pages while (m_sheet.GetPageCount()) { m_sheet.RemovePage(0); } and than adding the pages (except the one i want to hide) to the sheet again m_sheet.AddPage(&m_tree, 0); m_sheet.AddPage(&m_calculate,7); m_sheet.AddPage(&m_cad,12); The problem is that removing a page in the way i did will destroy the page and adding the page will recreate it. But I need to hold the state of the page furthermore. Maybe someone has an idea! Best regards, Tabor

    D 1 Reply Last reply
    0
    • T tabor25

      Hello, I need to know how to hide a CPropertyPage at runtime in my app. I thought that it could be done by first removing all the pages while (m_sheet.GetPageCount()) { m_sheet.RemovePage(0); } and than adding the pages (except the one i want to hide) to the sheet again m_sheet.AddPage(&m_tree, 0); m_sheet.AddPage(&m_calculate,7); m_sheet.AddPage(&m_cad,12); The problem is that removing a page in the way i did will destroy the page and adding the page will recreate it. But I need to hold the state of the page furthermore. Maybe someone has an idea! Best regards, Tabor

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      See if MSDN article Q151662 helps. I've used it in several of my projects.


      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

      T L 2 Replies Last reply
      0
      • D David Crow

        See if MSDN article Q151662 helps. I've used it in several of my projects.


        "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

        T Offline
        T Offline
        tabor25
        wrote on last edited by
        #3

        Thank you very much, i will check this! Best regards Tabor

        1 Reply Last reply
        0
        • D David Crow

          See if MSDN article Q151662 helps. I've used it in several of my projects.


          "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

          L Offline
          L Offline
          laiju
          wrote on last edited by
          #4

          sorry couldnt get the article Q151662 .Searched in msdn site and google.too. Thanx for the info. Meanwhile I tried a lot to disable the save tool button on the toolbar. I tried SetButtonInfo in the foll. code but in vain. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME1)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } // TODO: Delete these three lines if you don't want the toolbar to be dockable m_wndToolBar.EnableDocking(CBRS_ALIGN_TOP); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); TBBUTTONINFO buttonInfo; UINT buttonID; buttonID = ID2_FILE_SAVE; m_wndToolBar.GetToolBarCtrl().GetButtonInfo(ID2_FILE_SAVE, &buttonInfo); buttonInfo.fsState = TBSTATE_INDETERMINATE ; m_wndToolBar.GetToolBarCtrl().SetButtonInfo(ID2_FILE_SAVE, &buttonInfo); return 1; } laiju

          D P 2 Replies Last reply
          0
          • L laiju

            sorry couldnt get the article Q151662 .Searched in msdn site and google.too. Thanx for the info. Meanwhile I tried a lot to disable the save tool button on the toolbar. I tried SetButtonInfo in the foll. code but in vain. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME1)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } // TODO: Delete these three lines if you don't want the toolbar to be dockable m_wndToolBar.EnableDocking(CBRS_ALIGN_TOP); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); TBBUTTONINFO buttonInfo; UINT buttonID; buttonID = ID2_FILE_SAVE; m_wndToolBar.GetToolBarCtrl().GetButtonInfo(ID2_FILE_SAVE, &buttonInfo); buttonInfo.fsState = TBSTATE_INDETERMINATE ; m_wndToolBar.GetToolBarCtrl().SetButtonInfo(ID2_FILE_SAVE, &buttonInfo); return 1; } laiju

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            laiju wrote: sorry couldnt get the article Q151662 .Searched in msdn site and google.too. Really? http://support.microsoft.com/default.aspx?scid=kb;en-us;151662


            "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

            1 Reply Last reply
            0
            • L laiju

              sorry couldnt get the article Q151662 .Searched in msdn site and google.too. Thanx for the info. Meanwhile I tried a lot to disable the save tool button on the toolbar. I tried SetButtonInfo in the foll. code but in vain. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME1)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } // TODO: Delete these three lines if you don't want the toolbar to be dockable m_wndToolBar.EnableDocking(CBRS_ALIGN_TOP); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); TBBUTTONINFO buttonInfo; UINT buttonID; buttonID = ID2_FILE_SAVE; m_wndToolBar.GetToolBarCtrl().GetButtonInfo(ID2_FILE_SAVE, &buttonInfo); buttonInfo.fsState = TBSTATE_INDETERMINATE ; m_wndToolBar.GetToolBarCtrl().SetButtonInfo(ID2_FILE_SAVE, &buttonInfo); return 1; } laiju

              P Offline
              P Offline
              PJ Arends
              wrote on last edited by
              #6

              laiju wrote: sorry couldnt get the article Q151662 .Searched in msdn site and google.too. http://www.codeproject.com/tips/kblaunch.asp[^]


              "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!


              Honoured as one of The Most Helpful Members of 2004

              L 1 Reply Last reply
              0
              • P PJ Arends

                laiju wrote: sorry couldnt get the article Q151662 .Searched in msdn site and google.too. http://www.codeproject.com/tips/kblaunch.asp[^]


                "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!


                Honoured as one of The Most Helpful Members of 2004

                L Offline
                L Offline
                laiju
                wrote on last edited by
                #7

                thanx for the link i have fixed it already. thanx once again laiju

                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