用一个CTreeCtrl引用控制一个CTreeView对象后.如何来对它的属性进行设定呢.
比如是否有连接线,是否有+ -等.

解决方案 »

  1.   

    CTreeCtrl::ModifyStyleTVS_HASLINES   The tree view control has lines linking child items to their corresponding parent items.
    TVS_LINESATROOT   The tree view control has lines linking child items to the root of the hierarchy.
    TVS_HASBUTTONS   The tree view control adds a button to the left of each parent item.
    TVS_EDITLABELS   The tree view control allows the user to edit the labels of tree view items.
    TVS_SHOWSELALWAYS   Causes a selected item to remain selected when the tree-view control loses focus.
    TVS_DISABLEDRAGDROP   The tree-view control is prevented from  sending TVN_BEGINDRAG notification messages.
    TVS_NOTOOLTIPS   The tree view control uses no tooltips.
    TVS_SINGLEEXPAND   When this style is enabled, changing the selection in the tree view will automatically cause the item being selected to expand and the item being unselected to collapse. If the mouse is used to single-click the selected item and that item is closed, it will be expanded. If the selected item is single-clicked when it is open, it will be collapsed. 
      

  2.   

    我用了
    不过一调用这函数就会出错.
    不知道为什么,complie可通过.我又用了ModifystyleEx虽然不出错但是属性的设定,
    却没法成功,
    设有连接线可还是没有.
    当我设有button时,
    它在整个窗口中设了一个大按钮.
      

  3.   

    谢谢wuxq(好好) 我一开始先用getstyle得到一个DWORD DT
    然后调用ModifyStyle(DT,XXX|xxxx,0);
    以作为它的参数,
    这样一直有问题,
    不知道为什么.后来我用
    ModifyStyle(0,xx|xxx,0);
    这样就很好,
    不知道为什么.:::
    师兄再来帮帮我吧.?
      

  4.   

    BOOL CLeftView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) 
    {
    // TODO: Add your specialized code here and/or call the base class
    dwStyle |= TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT; return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
    }