منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : محتاج مساعده في برنامج لتشغيل الملفات الصوتية
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم انا بصمم برنامج لتشغيل الملفات الصوتية بس واقف قدامي حاجه واحده انا عامل قائمة تشغيل( play list (listbox وعايز كود يسمح لي بنقل الملفات الي listbox عن طريق مؤشر الموس بحيث يظهر لي في listbox مسار  الملف
(21-01-16, 04:21 PM)مدحت رمضان كتب : [ -> ]عايز كود يسمح لي بنقل الملفات الي listbox عن طريق مؤشر الموس بحيث يظهر لي في listbox مسار  الملف

هذا الكود
PHP كود :
Imports System.IO
Public Class Form1
    Private Sub ListBox1_DragDrop
(sender As ObjectAs DragEventArgsHandles ListBox1.DragDrop
        Dim files
() As String e.Data.GetData(DataFormats.FileDrop)
 
       ListBox1.Items.Clear()
 
       For Each file In files
            If Path
.GetExtension(file) = ".mp3" Then ListBox1.Items.Add(file)
 
       Next
    End Sub
    Private Sub ListBox1_DragEnter
(sender As ObjectAs DragEventArgsHandles ListBox1.DragEnter
        e
.Effect DragDropEffects.Copy
    End Sub

    Private Sub Form1_Load
(sender As ObjectAs EventArgsHandles MyBase.Load
        ListBox1
.AllowDrop True
    End Sub
End 
Class 
فقط قم بسحب الملفات والقائها على الـListBox   Wink
(21-01-16, 05:43 PM)HASAN6.0 كتب : [ -> ]
(21-01-16, 04:21 PM)مدحت رمضان كتب : [ -> ]عايز كود يسمح لي بنقل الملفات الي listbox عن طريق مؤشر الموس بحيث يظهر لي في listbox مسار  الملف

هذا الكود
PHP كود :
Imports System.IO
Public Class Form1
    Private Sub ListBox1_DragDrop
(sender As ObjectAs DragEventArgsHandles ListBox1.DragDrop
        Dim files
() As String e.Data.GetData(DataFormats.FileDrop)
 
       ListBox1.Items.Clear()
 
       For Each file In files
            If Path
.GetExtension(file) = ".mp3" Then ListBox1.Items.Add(file)
 
       Next
    End Sub
    Private Sub ListBox1_DragEnter
(sender As ObjectAs DragEventArgsHandles ListBox1.DragEnter
        e
.Effect DragDropEffects.Copy
    End Sub

    Private Sub Form1_Load
(sender As ObjectAs EventArgsHandles MyBase.Load
        ListBox1
.AllowDrop True
    End Sub
End 
Class 
فقط قم بسحب الملفات والقائها على الـListBox   Wink
شكرا علي الاجابة المفيده