26-03-13, 09:51 PM
sajad كتب :السلام عليكم
اعتقد الحل من خلال هذا الكود في الDragEnter
PHP كود :
If (e.Data.GetDataPresent(TypeOf e.Data Is Imaging.ImageFormat)) Then
e.Effect = DragDropEffects.All
End If
محمد كتب :جزاك الله خير شكرآ اخى
هل يمكن ايضآ مع الملفات الصوتية وى exe و ملفات الفيديو ?
جربت بى وضع Extension.ExtensionFormat
و Midea.MideaFormat
ولم ينفع
RainBow كتب :هذا هو الكود المطلوبجزاكم الله خير اخوتى
كود :
Dim s() As String = e.Data.GetData("FileDrop", False)
Dim i As Integer
Dim AllowedTypes As String = ".jpg .mp3 .exe"
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
MyFiles = e.Data.GetData(DataFormats.FileDrop)
MyNames = e.Data.GetData(DataFormats.FileDrop)
Dim name As String
For i = 0 To MyFiles.Length - 1
If AllowedTypes.Contains(Path.GetExtension(s(i))) Then
fileinfo = New IO.FileInfo(MyNames(i))
name = fileinfo.Name.Remove(fileinfo.Name.Length - 4, 4)
ListBox2.Items.Add(name)
End If
Next
For i = 0 To MyFiles.Length - 1
If AllowedTypes.Contains(Path.GetExtension(s(i))) Then
ListBox1.Items.Add(MyFiles(i))
End If
Next
End If
هذا الذى احتاجة اخى Rain
أبورائد لماذا لا يظهر زر الشكر و الاعجاب عندك !
