TreeView Cancel Expand/Collapse
Is there anyway to avoid a node to be collapsed or expanded when doubled-click. I know I can expand and/or collapse the node in the DoubleClick event... but I don't wan't the user to see the expand and collapse -or collapse and expand regarding it's initial status). TIA,
Re: TreeView Cancel Expand/Collapse
I guess maybe you count mouseclicks in the MouseDown events and trap the BeforeExpand/Collapse events (Ithink that's what they're called) to cancel the expand/collapse and reset the mouseclick counter. Also you would need some sort of timer to reset the mouseclick counter as well. Seems a bit of a crude hack though, must be a better way of doing it.
Re: TreeView Cancel Expand/Collapse
Also maybe something on this page might help you.
Re: TreeView Cancel Expand/Collapse
Quote:
Originally Posted by penagate
I guess maybe you count mouseclicks in the MouseDown events and trap the BeforeExpand/Collapse events (Ithink that's what they're called) to cancel the expand/collapse and reset the mouseclick counter. Also you would need some sort of timer to reset the mouseclick counter as well. Seems a bit of a crude hack though, must be a better way of doing it.
I only found these events on .Net. Does VB6 also have them?
Re: TreeView Cancel Expand/Collapse
Quote:
Originally Posted by Mc Brain
I only found these events on .Net. Does VB6 also have them?
Yes I just looked them up, they are called Expand and Collapse :)
Re: TreeView Cancel Expand/Collapse
Quote:
Originally Posted by penagate
Also maybe something on
this page might help you.
Ok, I might not explain myself correctly. I want to cancel the expand/collapse if the user double-clicks only. That example avoids to expand/collapse even with the "+" and "-".
Re: TreeView Cancel Expand/Collapse
Quote:
Originally Posted by penagate
Yes I just looked them up, they are called Expand and Collapse :)
Yes, but those events fires after the action itself. So, when I get to this point... the node has already been expanded or collapsed. I know I can collapse it or expand it but this is the flickering I want to avoid.