# Solved: Visual studio, drag files to Listbox?



## asedt (Jun 18, 2008)

Hi

I use Visual studio 2005, and program in Visual basic mode. I need to create a GUI and need help with this part:

I want to make a Listbox that i can drag and drop files from explorer to, and get the file paths in the Listbox. Only need to get the file paths entered to the Listbox.

Thx for all help


----------



## asedt (Jun 18, 2008)

BUMP

Still I have not find any soluton to this, it can't be that hard to do this winform. I have a program, with the sorce code lost, and need to re crate it so I know you can do it.


----------



## asedt (Jun 18, 2008)

Now It works, I'm so happy 

Start with:

http://msdn.microsoft.com/en-us/library/za0zx9y0(VS.80).aspx

And then replace some in step 2 and 3, use FileDrop:

Dim c() As String
ReDim c(20)
e.Data.GetData(DataFormats.FileDrop).CopyTo(c, 0)
ListBox1.Items.AddRange(c)

I don't know if it's right but it works.


----------



## Chicon (Jul 29, 2004)

asedt said:


> ...
> I don't know if it's right but it works.


Hi asedt,

If it works, it must be right !


----------

