fulminado

Hello!!!

I have created a little program that finds and shows thumbnails of all my autocad files. I now want to drag and drop them into autocad or at least at desktop. I don't mind if you can't tell me exactly what to do with the autocad file.I just want, if its possible, a general example of dragging from the application and dropping to anywhere.

Thank you very much,

your faithfully,

john.



Re: Visual Basic General How do i drag a file from my application to the desktop or to another application(not a .net one) ?


Re: Visual Basic General How do i drag a file from my application to the desktop or to another application(not a .net one) ?

Bruno Yu - MSFT

fulminado,

Use the Control.QueryContinueDrag event that Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled.

The following code shows the usage of this event:

Private Sub ListDragSource_QueryContinueDrag(ByVal sender As Object, ByVal e As QueryContinueDragEventArgs) Handles ListDragSource.QueryContinueDrag

' Cancel the drag if the mouse moves off the form.

Dim lb As ListBox = CType(sender, System.Windows.Forms.ListBox)

If (lb IsNot Nothing) Then

Dim f As Form = lb.FindForm()

' Cancel the drag if the mouse moves off the form. The screenOffset

' takes into account any desktop bands that may be at the top or left

' side of the screen.

If (((Control.MousePosition.X - screenOffset.X) < f.DesktopBounds.Left) Or _

((Control.MousePosition.X - screenOffset.X) > f.DesktopBounds.Right) Or _

((Control.MousePosition.Y - screenOffset.Y) < f.DesktopBounds.Top) Or _

((Control.MousePosition.Y - screenOffset.Y) > f.DesktopBounds.Bottom)) Then

e.Action = DragAction.Cancel

End If

End If

End Sub






Re: Visual Basic General How do i drag a file from my application to the desktop or to another application(not a .net one) ?

fulminado

Hello!
Thank you both for your answers but thats not exactly what i am asking for.
I want, to be more specific, to drag a thumbnail from my application and drop it to an autocad product. \it woulb be helpful even an example with a picture dragged from my visual basic 2005 application to the mspaint.
Thank you again and i look forward to hear again from you, if you have any other ideas.

Regards,
Fulminado.