When I double-click an unchecked node in a WinForms TreeView
, it visually goes to checked followed by unchecked.
However only one AfterCheck
event is fired as detected by the following event handler:
private void treeView1_AfterCheck( object sender, TreeViewEventArgs e )
{
System.Diagnostics.Debug.WriteLine( "{0} {1}: {2}", e.Node.Checked, e.Node, e.Action );
}
e.Node.Checked
is true
even though the visual representation in the GUI is unchecked.
Clicking the checkbox again raises an AfterCheck
event with Node.Checked
equal to false
. The checkbox remains unchecked on the GUI.
Vice-versa for double-clicking a checked node.
I'm compiling for .NET 4.0 with Visual Studio 2010 and running on .NET 4.5.1.
Any way to work around this?