我想问一下 :Csplitterwnd如何同CLISTVIEW一起使用用,我在使用的时候不能分割视图。
我想做个同资源管理器一样的界面。不过右边是用CListview显视
数据库,左边是一个树型目录。
  请各位帮忙如何实现,
 

解决方案 »

  1.   

    在CMainFrm类中添加CSplitterWnd m_wndSplitter;
    并用ClassWizard对CMainFrmod 类添加OnCreateClient(...)函数,在该函数中添加如下代码:
    m_wndSplitter.CreateStatic(this, 1, 2);
    if(!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CTreeView), CSize(300, 0), pContext);
       return false;
    if(!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CListView), CSize(0,0), pContext);
       return false;
    return TRUE;
      

  2.   

    但是同clistview冲突,
    不能分割只出现滚动条
      

  3.   


    是我错了,but now i want to get the special item of the treelist ,i used the 
    fucation getitem() or getnextitem()(to the clistview the getnextitem
    ()can get the selected item .),but i can get the item like the listview, how can i get the item i need trought a easy way.
    thanks !waiting for the key
      

  4.   

    1.先在CMainFrame类中加入CSplitterWnd数据成员 m_wndSplitter.2.在CMainFrame::OnCreateClient()的实现中加入如下代码:
    m_wndSplitter.CreateStatic(this, 1, 2);
    if((!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CTreeView), CSize(300, 0), pContext)||(!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CListView), CSize(0,0), pContext));
       return FALSE;return TRUE;3.完成!!