Insert property page after pr.-Sheet created?
-
Hi folks, my newest, coolest :) app uses a property sheet to expose some settings. Due to an action in one page (or s.th. like apply button in the sheet itself) I'd like to insert/remove an other property page. I'd be good also if there is some way to hide (and display) a property page ... Thanks for your help! Thomas
-
Hi folks, my newest, coolest :) app uses a property sheet to expose some settings. Due to an action in one page (or s.th. like apply button in the sheet itself) I'd like to insert/remove an other property page. I'd be good also if there is some way to hide (and display) a property page ... Thanks for your help! Thomas
Well, if the property sheet inserted/removed is always the last one, you can get by using
AddPage
andRemovePage
, but I guess you had already figured that out... Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
Well, if the property sheet inserted/removed is always the last one, you can get by using
AddPage
andRemovePage
, but I guess you had already figured that out... Joaquín M López Muñoz Telefónica, Investigación y DesarrolloJoaquin, thank your for your quick suggestion :rose: . The page in question *is* the last one on the sheet, but it won't work: CMyPropertySheet::OnSomeMessage(......) { RemovePage(&m_myPage); AddPage(&m_myPage); } The RemoveMessage function destroys the property page, and AddPage isn't enough to have the page created: I get an empty property sheet, all controls on it are not visible/created :((
-
Joaquin, thank your for your quick suggestion :rose: . The page in question *is* the last one on the sheet, but it won't work: CMyPropertySheet::OnSomeMessage(......) { RemovePage(&m_myPage); AddPage(&m_myPage); } The RemoveMessage function destroys the property page, and AddPage isn't enough to have the page created: I get an empty property sheet, all controls on it are not visible/created :((
mumble mumble... Maybe you should use a fresh
CPropertyPage
each time, like this:CMyPropertySheet::OnSomeMessage(......)
{
// Now m_pMyPage is a pointer to CMyPropertyPage instead of a CMyPropertyPage
RemovePage(m_pMyPage);
delete m_pMyPage;
m_pMyPage=new CMyPropertyPage();
AddPage(m_pMyPage);
}Why don't you try this and tell us if it works? :) Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
mumble mumble... Maybe you should use a fresh
CPropertyPage
each time, like this:CMyPropertySheet::OnSomeMessage(......)
{
// Now m_pMyPage is a pointer to CMyPropertyPage instead of a CMyPropertyPage
RemovePage(m_pMyPage);
delete m_pMyPage;
m_pMyPage=new CMyPropertyPage();
AddPage(m_pMyPage);
}Why don't you try this and tell us if it works? :) Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
Joaquín, thank you, that was the right trick. Once the property page has been created (OnInitDialog is done) you cannot RemovePage it and reuse the same object instance. Thomas