16,555
社区成员
发帖
与我相关
我的任务
分享
'Me.Panel1.AllowDrop = True
Private Sub Panel1_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Panel1.DragDrop
Dim str() As String = CType(e.Data.GetData(DataFormats.FileDrop, False), String())
If str.Length > 1 Then
Exit Sub
Else
sender.Text = str(0)
Me.PictureBox1.ImageLocation = str(0)
End If
End Sub
Private Sub Panel1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Panel1.DragEnter
If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
e.Effect = DragDropEffects.Move
Else
e.Effect = DragDropEffects.None
End If
End Sub