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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

In order to hide/show a view you must show/hide its frame window:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

@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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.