تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
ListBox DragDrop تعديل هذا الكود
#1
كيف عمل ListBox DragDrop لى صيغة معيبة وليس لى جميع الصغات بمعنى مثلآ لو الملف صيغة jpg يتم DragDrop غير كده لا يتم
او ممكن تعديل هذا الكود
كود :
Dim fileinfo As IO.FileInfo

    Dim MyFiles() As String
    Dim MyNames() As String
    Private Sub ListBox2_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox2.DragDrop
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            Dim i As Integer
            MyFiles = e.Data.GetData(DataFormats.FileDrop)
            MyNames = e.Data.GetData(DataFormats.FileDrop)
            Dim name As String
            For i = 0 To MyFiles.Length - 1
                fileinfo = New IO.FileInfo(MyNames(i))
                name = fileinfo.Name.Remove(fileinfo.Name.Length - 4, 4)
                ListBox2.Items.Add(name)
            Next
            For i = 0 To MyFiles.Length - 1
                ListBox1.Items.Add(MyFiles(i))
            Next
        End If
    End Sub

    Private Sub ListBox2_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox2.DragEnter
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            e.Effect = DragDropEffects.All
        End If
    End Sub
هذا الموود يتم اضافه جميع الصيغات انا اريده صيغة محدوده فقط
شكرآ
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
ListBox DragDrop تعديل هذا الكود - بواسطة محمد_mybb_import4755 - 26-03-13, 02:53 PM
ListBox DragDrop تعديل هذا الكود - بواسطة Sajad - 26-03-13, 07:43 PM
ListBox DragDrop تعديل هذا الكود - بواسطة RainBow - 26-03-13, 09:27 PM


التنقل السريع :


يقوم بقرائة الموضوع: