这是一个非常奇怪:ListView的dragEnter事件,的dragover,DragDrop事件(的AllowDrop = TRUE)
我的应用程序工作得很好,但突然该死的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出了问题。
是的。奇怪的是,它有一段时间的工作,但突然中断。 – TheAgent 2009-02-17 15:03:10
是什么东西可能会改变你的代码中某处AllowDrop的价值? – 2009-02-17 15:07:48
我查过了。属性值为True且完好无损。 – TheAgent 2009-02-19 09:58:57