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. Property Sheet in FormView

Property Sheet in FormView

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

    I want to incorporate a property sheet and pages in side a Form view. Any solution?? With Thanks and Regards --Kamesh

    P 1 Reply Last reply
    0
    • K Kamesh

      I want to incorporate a property sheet and pages in side a Form view. Any solution?? With Thanks and Regards --Kamesh

      P Offline
      P Offline
      Pavel Klocek
      wrote on last edited by
      #2

      You need to do the following: 1) Add a frame control with ID_PLACEHOLDER into your dialog and use it to define size and position of the property sheet in your form/dialog. 2) In OnInitialUpdate() method of your form class use the following to create the property sheet (m_sheet is a member of the form class, a pointer to a property sheet class ):

      CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PLACEHOLDER);
      m_sheet = new CMyPropertySheet(pwndPropSheetHolder);
      if (!m_sheet->Create(pwndPropSheetHolder,WS_CHILD | WS_VISIBLE,0))
      {
      delete m_sheet;
      m_sheet = NULL;
      return;
      }

      Pavel Sonork 100.15206

      K 1 Reply Last reply
      0
      • P Pavel Klocek

        You need to do the following: 1) Add a frame control with ID_PLACEHOLDER into your dialog and use it to define size and position of the property sheet in your form/dialog. 2) In OnInitialUpdate() method of your form class use the following to create the property sheet (m_sheet is a member of the form class, a pointer to a property sheet class ):

        CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PLACEHOLDER);
        m_sheet = new CMyPropertySheet(pwndPropSheetHolder);
        if (!m_sheet->Create(pwndPropSheetHolder,WS_CHILD | WS_VISIBLE,0))
        {
        delete m_sheet;
        m_sheet = NULL;
        return;
        }

        Pavel Sonork 100.15206

        K Offline
        K Offline
        Kamesh
        wrote on last edited by
        #3

        Thanks for the sugesstion , i have done as u suggesst, but system is failing in allocating memory for the property sheet pointer, and returning. What should i do?? With Thanks and Regards --Kamesh

        P 1 Reply Last reply
        0
        • K Kamesh

          Thanks for the sugesstion , i have done as u suggesst, but system is failing in allocating memory for the property sheet pointer, and returning. What should i do?? With Thanks and Regards --Kamesh

          P Offline
          P Offline
          Pavel Klocek
          wrote on last edited by
          #4

          Are you creating it after the inherited OnInitialUpdate is called? Returns the GetDlgItem(IDC_PLACEHOLDER) a valid pointer? Also I missed a part of the code, after the sheet is created, you need to set it's size and position:

          CRect rectPropSheet;
          pwndPropSheetHolder->GetWindowRect(rectPropSheet);
          m_sheet->SetWindowPos(NULL, 0, 0,
          rectPropSheet.Width(), rectPropSheet.Height(),
          SWP_NOZORDER | SWP_NOACTIVATE);

          Pavel Sonork 100.15206

          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