日期:2014-05-19  浏览次数:21044 次

Winform中,在两个TreeView控件之间进行拖放操作,如何使得拖到目标TreeView时能自动高亮显示鼠标移过的节点?
选中源TreeView的节点,   拖到目标TreeView的节点时,   经过的节点会高亮显示,   如何做到?

------解决方案--------------------
private void Treeview1_DragOver(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(typeof(DPAUInfo)))
{
TreeViewHitTestInfo hti = this.tvTarget.HitTest(this.Treeview1.PointToClient(new Point(e.X, e.Y)));
this.Treeview1.SelectedNode = hti.Node;
}
}