03-08-13, 10:05 PM
[SIZE=5]السلام عليكم
بالنسبة للسؤال الاول
اعطيك مثال [/SIZE]
ادرج زر وlistbox
ضع في شاشة كود الزر الكود التالي
علما بان الكود منقول من اجل استعراض اكثر من ملف مع اضافة بعض التعديلات
ارجو ان يكون هذا هو المطلوب
O_o
بالنسبة للسؤال الاول
اعطيك مثال [/SIZE]
ادرج زر وlistbox
ضع في شاشة كود الزر الكود التالي
إقتباس :
Dim openFile As New OpenFileDialog()
With openFile
.Title = "استيرد ملفات فيديو"
.Filter = "Microsoft Data Base (*.Mp4)|*.Mp4"
.FilterIndex = 0
.Multiselect = True
.ShowDialog()
If .FileName = "" Then Exit Sub
' تستطيع هنا ان تحذف السطر التالي اذا اردت اضافة ملفات فيديو في كل مرة تضغط على زر الاستعراض
ListBox1.Items.Clear()
Dim file As String
For Each file In .FileNames
' Create a PictureBox for each file, and add that file to the FlowLayoutPanel.
Try
ListBox1.Items.Add(file)
Catch SecEx As SecurityException
' The user lacks appropriate permissions to read files, discover paths, etc.
MessageBox.Show("Security error. Please contact your administrator for details.\n\n" & _
"Error message: " & SecEx.Message & "\n\n" & _
"Details (send to Support):\n\n" & SecEx.StackTrace)
Catch ex As Exception
' Could not load the image - probably permissions-related.
MessageBox.Show(("Cannot display the image: " & file.Substring(file.LastIndexOf("\"c)) & _
". You may not have permission to read the file, or " + "it may be corrupt." _
& ControlChars.Lf & ControlChars.Lf & "Reported error: " & ex.Message))
End Try
Next file
End With
علما بان الكود منقول من اجل استعراض اكثر من ملف مع اضافة بعض التعديلات
ارجو ان يكون هذا هو المطلوب
O_o
