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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I make a CTreeCtrl element not to open after a double click?

Status
Not open for further replies.

firelex

Programmer
Jan 10, 2002
118
DE
Hello, all!
The problem is:
I have a [tt]CTreeCtrl[/tt] tree with 2 levels of elements. I want a dialog to be opened after a double click on one of the tree-elements performes. So I used [tt]NM_DBLCLK[/tt] message. I works all OK, but if a double click performes on an element with a subelement, so after the dialog is closed the element toggles its state. i.e. opens the sub tree if it was closed and closes if it was opened. How can I prevent that? I mean that a subtree shouldn't open after a double click.
 
subclass it

Ion Filipski
1c.bmp
 
It goes much easier ;))

I have a function:
Code:
void CMyClass::OnDblclkTree(NMHDR* pNMHDR, LRESULT* pResult) 
{
   OnEdit();
   [COLOR=green]//Here instead[/color]
   [COLOR=green]//[/color][COLOR=#ff0000]*pResult = 0;[/color]
   [COLOR=green]//use[/color]
   *pResult = 1;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top