You cannot doubleclick on the +/- of the treenodes. The nodes expand and collapse on a single click. I tried suppressing the doubleclick but as SAKryukov says, its not possible to do that. Its because the event
BeforeExpand
gets handled before the event
MouseDoubleClick
, otherwise we could have cancelled the expansion of nodes by setting the
e.Cancel = true
in the
BeforeExpand
event.
Here is how I tried:
private bool isDoubleClick = false;
void treeView1_MouseDoubleClick(object sender, MouseEventArgs e)
{
isDoubleClick = true;
}
void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
if (isDoubleClick == true)
{
e.Cancel = true;
}
}