all groups > dotnet windows forms > july 2005 >
You're in the

dotnet windows forms

group:

Getting to the default "drag" cursor while dragging the TreeNode


Getting to the default "drag" cursor while dragging the TreeNode Vlad
7/29/2005 10:46:41 PM
dotnet windows forms: Hi all.

Is there a way to get to the default "drag" cursor
("arrow-and-some-rectangle") during drag-and-drop? I'm doing drag-and-drop
in TreeView and need to show user that he/she cannot drop dragged item in
particular nodes. So, this part actually works great, user sees Cursors.No
while dragging over invalid node in the tree. But what if the next node is
valid for dropping? I tried Cursors.Default, it shows the system default
pointer (of course). Can I get to the default "drag" cursor back? I tried to
set the UseDefaultCursors of GiveFeedbackEventArgs to true and false with no
result.

Thanks for any kind of help!!

RE: Getting to the default "drag" cursor while dragging the TreeNode Tarun Gujral
7/29/2005 11:10:02 PM
HI

Try handling in Drag Over event of Tree View. If its

1.Valid node set e.Effects = DragDropEffects.Move // Default Curesor
+Rectangle cursor

2. Invalid Node Set e.Effects = DragDropEffects.None

-----------------------------------------------------------------------------

[quoted text, click to view]
Re: Getting to the default "drag" cursor while dragging the TreeNode Vlad
7/30/2005 8:23:01 PM
Thanks!! This is exactly what I was looking for.


[quoted text, click to view]

AddThis Social Bookmark Button