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.
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.