Question [RESOLVED] problem when doubleclick occurs on the node of a tree view

lavoyech

Member
Joined
Jun 19, 2012
Messages
7
Programming Experience
Beginner
Hello,

I have a problem of interaction between simple click and double click on a treeview.

Tipycally, depending on the checked state of a treeview's node i manage the nodeclick event to change the format of the associated label (checked -> bold / unchecked -> regular).

But if i double clicked on the node this is not working good anymore (checked -> regular / unchecked ->bold). It seems to have an interaction between the nodeclick event that i managed and an auto-managed node doubleclick event...

I found some explanations about this topic but i don't really understant how to disable the nodedouble clicked event (i'm beginner).

Does anyone have advices or remarks to help me to solve this problem?

Best regards,
Christophe
 
There is NodeMouseClick and NodeMouseDoubleClick events, if that is what you're talking about?

TreeView also has CheckBoxes property to show those.
 
that's what i used.

In fact in the node mouseclick event i check the state of the checkbox associated to the node i change the label format depending on this state.

If two following clicks are not fast it's ok.

but if you double click it implies a wrong behaviour that's why i try to manage or disable the doubleclick event..
 
This problem seems to be inherent to windows 7.. if i tried same code in vb.net and winXP environment the problem disappears...
 
It is still not clear to me what you mean, and I don't have W7 so if a behaviour/bug is specific to that I can't help you.
What I do know is that single click mean select node and and doubleclick means expand/collapse if there are child nodes.
 
ok,
so by single click i mean click on the chekbox associated to the node and not select the node
when i click on the chekbox i use nodemouseclick event or aftercheck event to manage the change of format (i only use one of those two events, i just want to sasy that they give a same result)

by double click i mean double ckick on the checkbox. i didn't implement this event. then if you double click on the checkbox there is no collapse or expand action.
The problem is just that instead of associate checked state with bold and unchecked state with regular, double click invert the process (checked state with regular and unchecked state with bold).

I saw that the behaviour of the treeview (like double click implying or not expnd/collapse automatically) differs from XP to 7 environnement.
But i you just have an idea about something to test or to try it will be helpfull for me..

Thanks

I
 
Back
Top