How to highlight target node while dragging?

You can try something like this: private void treeView_DragOver(object sender, DragEventArgs e) { ClearBackground(treeView. Nodes); Point p = treeView. PointToClient(new Point(e.

X, e. Y)); TreeNode node = treeView. GetNodeAt(p.

X, p. Y); node. BackColor = Color.

Aquamarine; } private void ClearBackground(TreeNodeCollection nodes) { foreach (TreeNode node in nodes) { node. BackColor = Color. White; ClearBackground(node.

Nodes); } } Edit Here's an improved version that shouldn't cause flickering: private void treeView_DragOver(object sender, DragEventArgs e) { Point p = treeView. PointToClient(new Point(e. X, e.

Y)); TreeNode node = treeView. GetNodeAt(p. X, p.

Y); if (node. PrevVisibleNode! = null) { node.PrevVisibleNode.

BackColor = Color. White; } if (node. NextVisibleNode!

= null) { node.NextVisibleNode. BackColor = Color. White; } node.

BackColor = Color. Aquamarine; }.

– ikel Nov 16 at 7:02 if the height of the treeview items are constant, you can probably drop the recursive ClearBackground method and only change the background color of the items above and below the current item back to white – Veldmuis Nov 16 at 8:22 Or better yet, just use node. NextVisibleNode & node. PrevVisibleNode and revert their background colors if not null – Veldmuis Nov 16 at 8:25 great the improved version works much better, thanks a lot for the help – ikel Nov 160 at 3:34.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions