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