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. Splitter View Problem in MFC.

Splitter View Problem in MFC.

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++
4 Posts 3 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.
  • R Offline
    R Offline
    Rishav Prabhakar
    wrote on last edited by
    #1

    Following is the code which i wrote to implement a splitter view to join together 5 dialog. Problem is the split window at the bottom screen occupies the whole form area please help me to remove the error.

    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
    {
    //Create Splitter Window
    m_wndSplitter.CreateStatic(this, 2, 1);
    m_wndSplitter2.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (0, 0));
    m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CFormLeft), CSize(200,100), pContext);
    m_wndSplitter1.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (1, 0));
    m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CFormBottomLeft), CSize(200,100), pContext);
    m_wndSplitter1.CreateView(0, 1, RUNTIME_CLASS(CFormBottomRight), CSize(200,100), pContext);
    m_wndSplitter3.CreateStatic(&m_wndSplitter2, 2, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter2.IdFromRowCol (0, 1));
    m_wndSplitter3.CreateView(0, 0, RUNTIME_CLASS(CFormRightUp), CSize(200,100), pContext);
    m_wndSplitter3.CreateView(1, 0, RUNTIME_CLASS(CFormRightBottom), CSize(200,100), pContext);
    return TRUE;
    }

    _ S 2 Replies Last reply
    0
    • R Rishav Prabhakar

      Following is the code which i wrote to implement a splitter view to join together 5 dialog. Problem is the split window at the bottom screen occupies the whole form area please help me to remove the error.

      BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
      {
      //Create Splitter Window
      m_wndSplitter.CreateStatic(this, 2, 1);
      m_wndSplitter2.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (0, 0));
      m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CFormLeft), CSize(200,100), pContext);
      m_wndSplitter1.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (1, 0));
      m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CFormBottomLeft), CSize(200,100), pContext);
      m_wndSplitter1.CreateView(0, 1, RUNTIME_CLASS(CFormBottomRight), CSize(200,100), pContext);
      m_wndSplitter3.CreateStatic(&m_wndSplitter2, 2, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter2.IdFromRowCol (0, 1));
      m_wndSplitter3.CreateView(0, 0, RUNTIME_CLASS(CFormRightUp), CSize(200,100), pContext);
      m_wndSplitter3.CreateView(1, 0, RUNTIME_CLASS(CFormRightBottom), CSize(200,100), pContext);
      return TRUE;
      }

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      I believe you need to create views for all the panes that you create. So after you create a splitter with m_wndSplitter having 2 rows, you need to create 2 views in these 2 rows before creating the next splitter with m_wndSplitter2.

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++)

      Polymorphism in C

      1 Reply Last reply
      0
      • R Rishav Prabhakar

        Following is the code which i wrote to implement a splitter view to join together 5 dialog. Problem is the split window at the bottom screen occupies the whole form area please help me to remove the error.

        BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
        {
        //Create Splitter Window
        m_wndSplitter.CreateStatic(this, 2, 1);
        m_wndSplitter2.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (0, 0));
        m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CFormLeft), CSize(200,100), pContext);
        m_wndSplitter1.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (1, 0));
        m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CFormBottomLeft), CSize(200,100), pContext);
        m_wndSplitter1.CreateView(0, 1, RUNTIME_CLASS(CFormBottomRight), CSize(200,100), pContext);
        m_wndSplitter3.CreateStatic(&m_wndSplitter2, 2, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter2.IdFromRowCol (0, 1));
        m_wndSplitter3.CreateView(0, 0, RUNTIME_CLASS(CFormRightUp), CSize(200,100), pContext);
        m_wndSplitter3.CreateView(1, 0, RUNTIME_CLASS(CFormRightBottom), CSize(200,100), pContext);
        return TRUE;
        }

        S Offline
        S Offline
        Software_Developer
        wrote on last edited by
        #3

        Does [this] article help?

        R 1 Reply Last reply
        0
        • S Software_Developer

          Does [this] article help?

          R Offline
          R Offline
          Rishav Prabhakar
          wrote on last edited by
          #4

          Yup it helped. But actually what i did was to resize the dialog boxes after all the splitter controls were created.

          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