up
>不停打噎中怎么 办?
挠墙

解决方案 »

  1.   

    从CScrollBar派生子类自绘制外观,SubClass子类化CTreeCtrl和CListCtrl的Scroll Bar即可!
      

  2.   

    在头文件里定义:
    CImageList m_ImageList;
             void PopulateTree();然后:
    void CLeftView::PopulateTree()
    {
    CTreeCtrl &tc = GetTreeCtrl(); // Create image list m_ImageList.Create(16, 16, ILC_COLORDDB | ILC_MASK, 0, 1); CBitmap bmBITMAP1, bmBITMAP2, bmBITMAP3, bmBITMAP4; // load images and populate image list -GGH
    bmBITMAP1.LoadBitmap(IDB_BITMAP1);
    bmBITMAP2.LoadBitmap(IDB_BITMAP2);
    bmBITMAP3.LoadBitmap(IDB_BITMAP3);
    bmBITMAP4.LoadBitmap(IDB_BITMAP4); m_ImageList.Add(&bmBITMAP1, RGB(192, 192, 192));
    m_ImageList.Add(&bmBITMAP2, RGB(192, 192, 192));
    m_ImageList.Add(&bmBITMAP3, RGB(192, 192, 192));
    m_ImageList.Add(&bmBITMAP4, RGB(33,45,55,)); tc.SetImageList(&m_ImageList, TVSIL_NORMAL); HTREEITEM hItem;
    hItem = tc.InsertItem("地点",0,0);
    if (hItem)
    {   
    tc.InsertItem("省份",0,0,hItem);
    tc.InsertItem("景点",0,0,hItem);
    tc.InsertItem("城市",0,0,hItem);

    }
    // expand
    tc.Expand(hItem, TVE_EXPAND);

    hItem = tc.InsertItem("景色",1,1);
    if (hItem)
    {
    tc.InsertItem("名山",1,1,hItem);
    tc.InsertItem("绣水",1,1,hItem);
    tc.InsertItem("名胜",1,1,hItem);
            tc.InsertItem("古迹",1,1,hItem);
    }
    // expand
    tc.Expand(hItem, TVE_EXPAND); hItem = tc.InsertItem("交通",2,2);
    if (hItem)
    {
    tc.InsertItem("飞机",2,2,hItem);
    tc.InsertItem("火车",2,2,hItem);
    tc.InsertItem("汽车",2,2,hItem);
    tc.InsertItem("轮船",3,3,hItem);
        
    }
    // expand
    tc.Expand(hItem, TVE_EXPAND);

      
    }
      

  3.   

    to spoonyboy
    >SubClass子类化CTreeCtrl和CListCtrl的Scroll Bar 
    如何做,加入我已经重绘了外观,如何把新的CMyScrollBar和CTreeCtrl联系?我没有子类化的经验:(
     
      

  4.   

    若你的系统是winxp可以提供一种方法时你的程序使用xp样式的Scrollbar,若需要给Email
      

  5.   

    Scroll Bar(CScrollBar) 好像不能自画 :)
      

  6.   

    我在CFormView里面放了一个CTreeCtrl,结果CTreeCtrl加了太多东西之后高度和宽度显然已经超过了CFormView的可视区域的大小,可为嘛那个scrollbar不出来呢/