CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 1999
    Location
    Chile
    Posts
    177

    I cannot show a CListView control

    Hi all....

    I'm programming an SDI doc-view architecure program. The document is a splitterwindow with 2 views. The left one is a FormView control containing a Tree Control. The Right one is a Frame to display different views depending on the selected item of the tree control.

    The views on the right are ListView controls since they are all reports. My problem is that I cannot make the report view to be shown. If I use FormView control instead, with the ListCtrl, I can show it, but with an ugly black border, so I want to use ListView. My method to switch views is:


    void CRightPaneFrame::SwitchToView(UINT nView)
    {
    CView* pOldActiveView = GetActiveView();
    CView* pNewActiveView = NULL;

    switch( nView )
    {
    case VIEW_CONSUMO:
    pNewActiveView = (CView*) m_pConsumoView; break;
    case VIEW_ITEMS:
    pNewActiveView = (CView*) m_pItemsView; break;
    case VIEW_MEALS:
    pNewActiveView = (CView*) m_pMealsView; break;
    case VIEW_USERS:
    pNewActiveView = (CView*) m_pUserListView; break;
    case VIEW_DEVICES:
    pNewActiveView = (CView*) m_pDevicesView; break;
    }

    if( pNewActiveView )
    {
    if( pOldActiveView == pNewActiveView )
    return;
    SetActiveView(pNewActiveView);
    pNewActiveView->ShowWindow(SW_SHOW);
    pNewActiveView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
    if( pOldActiveView )
    {
    pOldActiveView->ShowWindow(SW_HIDE);
    pOldActiveView->SetDlgCtrlID(m_nCurrentViewID);
    }
    m_nCurrentViewID = nView;

    RecalcLayout();
    }
    }




    Where actually only m_pDevicesView is a CListView class, the others are CFormView. When I switch to the CListView control, the border doesn't appear, but the headers aren'd displayed, that is, the ListView appears blank.

    How can I do it?

    Thanks
    Jaime


  2. #2
    Join Date
    Apr 1999
    Location
    Melbourne, VIC
    Posts
    72

    I can show a CListView control

    Reply:
    I don't know what your problem is exactly but I have written a app which does this, the left view being a tree view and the rhs a list view. And another one with the left a formview & the right a list view. So I could send you that code if you still haven't worked it out.
    Cheers,
    Dwiz


  3. #3
    Join Date
    Aug 1999
    Location
    Chile
    Posts
    177

    Re: I can show a CListView control

    Thanks for your answer but I have solved the problem already, but I take this opportunity to ask you another question concerning a formview. I have on the right pane a Frame where I switch different views, ListViews and FormViews. I have no problems with ListView but when a Formview is shown, an ugly black border is shown too. I have set border none in Form resource but I still cannot make that border to disappear.

    I hope you know how to solve it
    Thanks

    Jaime


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured