这个很奇怪:
我的应用程序工作得很好,但是突然间该死的 ListView 控件的事件不再引发了。它只是来去匆匆,没有任何明确的理由。(显然)我已将 AllowDrop 属性设置为 True,并按如下方式处理 DragEnter、DragOver 和 DragDrop 事件:
Private Sub lstApplications_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lstApplications.DragDrop, Me.DragDrop
m_fileNames = CType(e.Data.GetData(DataFormats.FileDrop), String())
mnuType.Show(Cursor.Position, ToolStripDropDownDirection.BelowLeft)
End Sub
Private Sub lstApplications_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lstApplications.DragEnter, Me.DragEnter, lstApplications.DragOver, Me.DragOver
If chkMode.Checked OrElse Not e.Data.GetDataPresent(DataFormats.FileDrop, True) Then
e.Effect = DragDropEffects.None
Else
e.Effect = DragDropEffects.Copy
End If
End Sub
我在这两种方法中编写的代码无关紧要,因为没有引发任何事件。我在这里有什么遗漏吗?
我在另一台机器上运行相同的应用程序,它工作得很好。然后我重新启动了我自己的机器,一切又开始工作了。我不确定,但 Windows 似乎有问题。