Drag-Drop stops working after one or two days

G

Guest

I have a VS.NET windows application which use drag-drop feather. It works
fine when application start, but stops working after application run one or
two days. The application is related to Video process, CPU/Memory extensive.

The drag-drop is in a new windows form. It drags from TreeView Control to
other control in the same form. It cannot trigger ItemDrag event of TreeView
after drag-drop feather die.

Can you give me any idea? Thanks.
 
N

Nicholas Paldino [.NET/C# MVP]

Qingdong,

Without seeing the code, it is hard to say. Chances are there is some
sort of exception being thrown, but because all of the drag/drop actions are
performed in event handlers, the exception is swallowed.

What you want to do is wrap all of your event handling code related to
drag/drop in try/catch handlers, and see if an exception is thrown. Once
you find out where it is thrown, you can work from there to figure out what
the problem is.

Hope this helps.
 
G

Guest

Nicholas,

Here is the code:

Private Sub tvMapItems_ItemDrag(ByVal sender As Object, ByVal e As
System.Windows.Forms.ItemDragEventArgs) Handles tvMapItems.ItemDrag
If e.Item.GetType.Name = "FacilityMapNode" Then
DoDragDrop(e.Item, DragDropEffects.Move)
End If
End Sub

Private Sub picMap_DragEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles picMap.DragEnter
e.Effect = DragDropEffects.Move
End Sub

Private Sub picMap_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles picMap.DragDrop
...
End Sub
 
N

Nicholas Paldino [.NET/C# MVP]

That's the thing, without seeing what goes on in picMap_DragDrop, there
is nothing that can be determined.

I think that you should place try/catch blocks in your event handlers,
and log if there are exceptions.
 
G

Guest

Nicholas,

I think the drop event is never triggered, because the drag event should
have been fired first. For what ever reason, the tvMapItems_ItemDrag was not
fired, because there is no drag-move effect.

Nicholas Paldino said:
That's the thing, without seeing what goes on in picMap_DragDrop, there
is nothing that can be determined.

I think that you should place try/catch blocks in your event handlers,
and log if there are exceptions.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Qingdong Z. said:
Nicholas,

Here is the code:

Private Sub tvMapItems_ItemDrag(ByVal sender As Object, ByVal e As
System.Windows.Forms.ItemDragEventArgs) Handles tvMapItems.ItemDrag
If e.Item.GetType.Name = "FacilityMapNode" Then
DoDragDrop(e.Item, DragDropEffects.Move)
End If
End Sub

Private Sub picMap_DragEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles picMap.DragEnter
e.Effect = DragDropEffects.Move
End Sub

Private Sub picMap_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles picMap.DragDrop
...
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top