PDA

View Full Version : سوال: انتخاب چند فایل



hamed72
پنج شنبه 02 اردیبهشت 1389, 08:33 صبح
سلام بر دوستان عزیز من یه برنامه رو نوشتم که توش موزیک می خونه ولی توی پنجره open

فقط یک موزیک میتونم انتخاب کنم چطوری می شه چند تا موزیک انتخاب کنم و به ترتیب اون

پخش بشه ؟

mpmsoft
پنج شنبه 02 اردیبهشت 1389, 12:08 عصر
Private Sub cmdOpen_Click()

On Error GoTo ErrHandler
Dim vFiles As Variant
Dim lFile As Long

With CommonDialog1
.FileName = "" 'Clear the filename
.CancelError = True
.DialogTitle = "Select File(s)..."
.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNHideReadOnly 'Flags, allows Multi select, Explorer style and hide the Read only tag
.Filter = "All files (*.*)|*.*"
.ShowOpen
vFiles = Split(.FileName, Chr(0)) 'Splits the filename up in segments
If UBound(vFiles) = 0 Then ' If there is only 1 file then do this
List1.AddItem .FileName
List2.AddItem .FileTitle
Else
For lFile = 1 To UBound(vFiles) ' More than 1 file then do this until there are no more files
List1.AddItem vFiles(0) + "\" & vFiles(lFile)
List2.AddItem vFiles(lFile)
Next
End If
End With

Exit Sub
ErrHandler:
If Err <> cdlCancel Then
MsgBox Err.Description
End If

End Sub

hamed72
سه شنبه 14 اردیبهشت 1389, 23:26 عصر
Private Sub cmdOpen_Click()

On Error GoTo ErrHandler
Dim vFiles As Variant
Dim lFile As Long

With CommonDialog1
.FileName = "" 'Clear the filename
.CancelError = True
.DialogTitle = "Select File(s)..."
.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNHideReadOnly 'Flags, allows Multi select, Explorer style and hide the Read only tag
.Filter = "All files (*.*)|*.*"
.ShowOpen
vFiles = Split(.FileName, Chr(0)) 'Splits the filename up in segments
If UBound(vFiles) = 0 Then ' If there is only 1 file then do this
List1.AddItem .FileName
List2.AddItem .FileTitle
Else
For lFile = 1 To UBound(vFiles) ' More than 1 file then do this until there are no more files
List1.AddItem vFiles(0) + "\" & vFiles(lFile)
List2.AddItem vFiles(lFile)
Next
End If
End With

Exit Sub
ErrHandler:
If Err <> cdlCancel Then
MsgBox Err.Description
End If

End Sub


سلام دوست عزیز دستت درد نکنه من همین امشب دیدم خوب بود ولی این روی لیست

باکس اجراش می کنه من می خوام در مدیا پلیر ازش استفاده کنم ممنون میشم اگه کسی بزاره

yashar_2006
سه شنبه 05 بهمن 1389, 12:59 عصر
یه سوال
من تونستم همه فایل ها رو ادد کنم
حالا میخوام یه عملیات رو همه لیست انجام بدم
چیکار باید بکنم ؟