Cannot drop more then 1 item on UserControl running in Internet Explorer

J

Johan smith

What am I missing?
I want to drag and drop multiply files onto UserControl running in Internet
Explorer.

1. In a Class Library Project I have added User Control
2. Added a Label to the User Control and set the AllowDrop Property to True
3. added the following events:

Private Sub Label1_DragEnter(ByVal sender As Object, _
ByVal e As
System.Windows.Forms.DragEventArgs _
) Handles Label1.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop, False) = True Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub

Private Sub Label1_DragDrop(ByVal sender As Object, _
ByVal e As
System.Windows.Forms.DragEventArgs _
) Handles Label1.DragDrop
Dim filenames() As String =
CType(e.Data.GetData(DataFormats.FileDrop), String())
MessageBox.Show(filenames.Length)
End Sub

4. added ref in asp.net to the compiled dll

<OBJECT id="TestCtl1" classid="TestCtl.dll#testCtl.UserControl1"
VIEWASTEXT> </OBJECT>

The results of the DragDrop are always 1!
While running the user control on windows application and not on Internet
Explorer results in the correct length.

Any help will be appreciated.
 
A

Albrecht Scheidig

For me the follwing works (same scenario) in dragdrop-handler:
Dim fileNames() As String
fileNames = e.Data.GetData(DataFormats.FileDrop)
....

Btw. How will your control be installed on other machines than yours?

Albrecht
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top