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. Insert property page after pr.-Sheet created?

Insert property page after pr.-Sheet created?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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.
  • T Offline
    T Offline
    Thomas Blenkers
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • T Thomas Blenkers

      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

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      Well, if the property sheet inserted/removed is always the last one, you can get by using AddPage and RemovePage, but I guess you had already figured that out... Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      T 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        Well, if the property sheet inserted/removed is always the last one, you can get by using AddPage and RemovePage, but I guess you had already figured that out... Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        T Offline
        T Offline
        Thomas Blenkers
        wrote on last edited by
        #3

        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 :((

        J 1 Reply Last reply
        0
        • T Thomas Blenkers

          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 :((

          J Offline
          J Offline
          Joaquin M Lopez Munoz
          wrote on last edited by
          #4

          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

          T 1 Reply Last reply
          0
          • J Joaquin M Lopez Munoz

            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

            T Offline
            T Offline
            Thomas Blenkers
            wrote on last edited by
            #5

            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

            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