Oct 30, 2001 #1 tabaar Programmer Jun 12, 2001 34 US Q1: How to switch on/off lines at root, buttons, etc. when tree view already constructed? SetWindowLong or something else, how to call it? Q2: How to determine in OnItemexpanded() whether item was _expanded_ _or_ _collapsed_? Great Thanx!
Q1: How to switch on/off lines at root, buttons, etc. when tree view already constructed? SetWindowLong or something else, how to call it? Q2: How to determine in OnItemexpanded() whether item was _expanded_ _or_ _collapsed_? Great Thanx!
Oct 30, 2001 #2 Guest_imported New member Jan 1, 1970 0 1. long lStyle = GetWindowLong( hwndTreeCtrl, GWL_STYLE ); lStyle |= (TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT) ; SetWindowLong( hwndTreeCtrl, GWL_STYLE, lStyle ); 2. void CMyTreeView::OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult) { NM_TREEVIEW* pnmtv = (NM_TREEVIEW*)pNMHDR; TV_ITEM item = pnmtv->itemNew; *pResult = 0; switch ( pnmtv->action ) { case TVE_COLLAPSE: ... case TVE_EXPAND: ... } } Upvote 0 Downvote
1. long lStyle = GetWindowLong( hwndTreeCtrl, GWL_STYLE ); lStyle |= (TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT) ; SetWindowLong( hwndTreeCtrl, GWL_STYLE, lStyle ); 2. void CMyTreeView::OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult) { NM_TREEVIEW* pnmtv = (NM_TREEVIEW*)pNMHDR; TV_ITEM item = pnmtv->itemNew; *pResult = 0; switch ( pnmtv->action ) { case TVE_COLLAPSE: ... case TVE_EXPAND: ... } }