日期:2014-05-18  浏览次数:20824 次

关于treeview的问题。急
我想点击树的空白区域使选中树节点取消选中状态。怎么弄 ?
各位帮帮忙吧!

------解决方案--------------------
C# code
private void treeView1_MouseUp(object sender, MouseEventArgs e)
        {
            TreeNode td = this.treeView1.GetNodeAt(e.X, e.Y);
            if (td == null)
                this.treeView1.SelectedNode = null;
        }

------解决方案--------------------
探讨

C# codeprivate void treeView1_MouseUp(object sender, MouseEventArgs e)
{
TreeNode td = this.treeView1.GetNodeAt(e.X, e.Y);
if (td == null)
this.treeView1.SelectedNode = null;
}