Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Questions about CTreeView

Status
Not open for further replies.

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!
 
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:
...
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top