S
Steve Z
We have an app with a datagridview that we allow users to drag-drop files
into - basically displaying the filename dragged in.
Works in our shop - but not at the customer site (the customer did find one
workstation that it would work on though...).
At any rate - we worked up a simple app to test this with - here it is -
Form1, DataGridView1 - that's pretty much it.
At the customer site the DRAGENTER event is firing - as the
DragDropEffects.All is being set. But when you let go of the mouse - the
DragDrop event does not fire.
What would cause my .EXE's to not permit DragDrop? Workstations are all
Windws XP Pro SP2.
into - basically displaying the filename dragged in.
Works in our shop - but not at the customer site (the customer did find one
workstation that it would work on though...).
At any rate - we worked up a simple app to test this with - here it is -
Form1, DataGridView1 - that's pretty much it.
At the customer site the DRAGENTER event is firing - as the
DragDropEffects.All is being set. But when you let go of the mouse - the
DragDrop event does not fire.
What would cause my .EXE's to not permit DragDrop? Workstations are all
Windws XP Pro SP2.
Code:
Public Class Form1
Private Sub DataGridView1_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles DataGridView1.DragDrop
Dim dragfiles As String() =
CType(e.Data.GetData(DataFormats.FileDrop), String())
For i As Integer = 0 To dragfiles.Count - 1
Dim vendorfile As String = dragfiles(i)
DataGridView1.Rows.Add("hi")
DataGridView1.Rows(DataGridView1.Rows.Count - 2).Cells(0).Value
= vendorfile
Next
End Sub
Private Sub DataGridView1_DragEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles DataGridView1.DragEnter
e.Effect = DragDropEffects.All
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
DataGridView1.Columns.Add(0, "FileName")
End Sub
End Class