thielen
Wed Jun 15 07:45:02 CDT 2005
That fixed it - thanks - dave
--
thanks - dave
""Jeffrey Tan[MSFT]"" wrote:
> Hi Dave,
>
> Thanks for your feedback.
>
> Yes, with your sample project, I reproduced out this problem on my side.
>
> After doing some research, I found that it seems that DoDragDrop method
> calling in MouseDown event will prevent TreeView's selected node from
> changing. If we set some debug output in treeView1_MouseDown,
> treeView1_MouseUp and treeView1_BeforeSelect events, we will see that:
> 1. Without the DoDragDrop method calling in MouseDown, all 3 events will
> fire
> 2. With DoDragDrop method calling in MouseDown, treeView1_BeforeSelect do
> not fire, and the selection will to back to its original selected treenode.
>
> Currently, I still did not find the root cause for this issue. However, I
> want to tell that for ListView and TreeView controls, we should call
> DoDragDrop method in ItemDrag event to enable the drag&drop, this is
> documented in:
> "Performing Drag-and-Drop Operations in Windows Forms"
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
> vbtskStartingDragOperations.asp
>
> In the above document, you will see that:
> "Note Certain controls have custom drag-specific events. The ListView and
> TreeView controls, for example, have an ItemDrag event."
>
> So we should use ItemDrag event to start the drag&drop operation. Also,
> placing DoDragDrop method calling in ItemDrag event will not cause this
> problem.
>
> Hope this helps.
> ================================================
> Thank you for your patience and cooperation. If you have any questions or
> concerns, please feel free to post it in the group. I am standing by to be
> of assistance.
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
>
>