2 Replies - 368 Views - Last Post: 07 September 2019 - 12:15 PM Rate Topic: -----

#1 aezriel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-September 19

Drag a file and drop it to a portable device

Posted 06 September 2019 - 06:51 PM

I am trying to copy files from my program to a portable device, ie, my phone, by dragging a picturebox and dropping to Window Explorer.

I already have code and it works fine dropping files to local drives or flash drives.
Normally, I open a Window Explorer and navigate to my target folder, then drag the picturebox and drop it to the Window Explorer. Everything works fine except the target folder is on a portable device. All I get is a "stop/unable-to-copy cursor".

I just want to know if there is any trick copying files to portable devices? Are there any permission issues or something of sort?

Here is my code
    Private IsMouseDown As Boolean = False

    Private Sub PictureBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseDown
        IsMouseDown = True
    End Sub

    Private Sub PictureBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseMove
        If IsMouseDown Then
            IsMouseDown = False
            Dim DragFiles() As String = {"P:\My File.txt"}
            Dim DragObjects As DataObject = New DataObject(DataFormats.FileDrop, DragFiles)
            DoDragDrop(DragObjects, DragDropEffects.Copy)
        End If
    End Sub

    Private Sub PictureBox1_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseUp
        IsMouseDown = False
    End Sub



Is This A Good Question/Topic? 0
  • +

Replies To: Drag a file and drop it to a portable device

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,187
  • Joined: 12-June 08

Re: Drag a file and drop it to a portable device

Posted 06 September 2019 - 08:32 PM

Does this work with a usb drive?
Was This Post Helpful? 0
  • +
  • -

#3 aezriel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-September 19

Re: Drag a file and drop it to a portable device

Posted 07 September 2019 - 12:15 PM

It works fine dropping files to local hard drives and usb drives.
Just not the portable devices.
I have not tried the network drive though.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1