Public Sub picture_DragDrop(ByVal sender As Object,
ByVal e As System.Windows.Forms.DragEventArgs)
Dim paths As object() = e.Data.GetData(Windows.Forms.DataFormats.FileDrop)
For Each path As object In paths
For i As
Integer = 0 To 5 \'有可能打开6个聊天窗口
Dim frm
As WinForm.Form = Forms("聊天内容" & i) \'找出实施拖放的窗口
If
frm.Opened Then
If
frm.Name = Forms.ActiveForm.Name Then
Vars("c_fname") = FileSys.GetName(path)
If Vars("c_fname").Contains(".bmp") Or
Vars("c_fname").Contains(".jpg") Or
Vars("c_fname").Contains(".png") Then
Vars("c_fname") =
Vars("c_fname") & "|2"
Else
Vars("c_fname") = Vars("c_fname") &
"|1"
End If
MessageBox.Show(Vars("c_fname"))
frm.Controls("bnfswj").PerformClick
End
If
End If
Next
Next
sender.Cursor = System.Windows.Forms.Cursors.IBeam
End Sub
Public Sub picture_DragEnter(ByVal sender As Object,
ByVal e As System.Windows.Forms.DragEventArgs)
If
(e.Data.GetDataPresent(Windows.Forms.DataFormats.FileDrop)) Then
e.Effect = Windows.Forms.DragDropEffects.Link
sender.Cursor = System.Windows.Forms.Cursors.Arrow
Else
e.Effect =
Windows.Forms.DragDropEffects.None
End If
End Sub