Click to See Complete Forum and Search --> : I cannot show a CListView control


Jaime
September 2nd, 1999, 02:40 PM
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

d_wzrdv_z
September 13th, 1999, 12:40 AM
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

Jaime
September 13th, 1999, 10:36 AM
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