Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to drag and drop using a File Viewer?

Status
Not open for further replies.

ceyhorn

Programmer
Nov 20, 2003
93
0
0
US
I have a file viewer control which came with the VbPowerPack. I'm trying to get the drag and drop functionality going for files, but everytime I drop it in, it just shows up as the full file string and not an image. Has anyone had experience with this? Do I need to do somekind of refresh?

Thanks in advance,
Chris

Here is what i have for the dragdrop
Code:
Private Sub ListBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles FileViewer1.DragDrop
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            Dim MyFiles() As String
            Dim i As Integer

            ' Assign the files to an array.
            MyFiles = e.Data.GetData(DataFormats.FileDrop)
            ' Loop through the array and add the files to the list.
            For i = 0 To MyFiles.Length - 1
                FileViewer1.Items.Add(MyFiles(i))

            Next
        End If
    End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top