how to add show/hide Cviews?

i have 4 views in splitterpanes in one window..and other views are in to show/hide by clicking toolbarbuttons?
CView* CMainFrame::SelectView(UINT nViewID)

      CView* pNewView = ((CTresManApp*)AfxGetApp())->GetView(nViewID);

      return pNewView;

CView* CMainFrame::SwitchToView(CView *pNewView)
      CView* pOldActiveView = GetActiveView();
//      CView* pOldActiveView = ((CTresManApp*)AfxGetApp())->GetView(1);

      CDocument* pActiveDocument = GetActiveDocument();

      ASSERT(pOldActiveView != NULL);
      ASSERT(pActiveDocument != NULL);
      ASSERT(pOldActiveView->GetDocument() == pActiveDocument);

      if (pNewView != pOldActiveView)
            // Show the newly active view and hide the inactive view.

      return pOldActiveView;

presently i have activeview it enables by clicking respective toolbar buttons but i want to show all 4 views in one window by clicking one toolbar button.
is it possible to activate morethan 1 view at a time?..
Who is Participating?
alb66Connect With a Mentor Commented:
In order to hide/show a view you must show/hide its frame window:

ZoppoConnect With a Mentor Commented:

@alb66: this doesn't work for splitter windows.

I think you'll have to delete the view to hide and create a new view to show - you can find a sample code at - there's a function 'CMainFrame::OnView1' which demonstrates this.

Hope that helps,

Yes, my code show/hide all the views in the splitter window. May be I misunderstood the question.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.